mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-29 12:23:42 +03:00
Float test skipped where the server doesn't support inf.
This commit is contained in:
parent
a55e50b991
commit
21dfc2c592
|
@ -81,7 +81,7 @@ class TypesBasicTests(unittest.TestCase):
|
||||||
else:
|
else:
|
||||||
return self.skipTest("decimal not available")
|
return self.skipTest("decimal not available")
|
||||||
|
|
||||||
def testFloat(self):
|
def testFloatNan(self):
|
||||||
try:
|
try:
|
||||||
float("nan")
|
float("nan")
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
@ -90,6 +90,13 @@ class TypesBasicTests(unittest.TestCase):
|
||||||
s = self.execute("SELECT %s AS foo", (float("nan"),))
|
s = self.execute("SELECT %s AS foo", (float("nan"),))
|
||||||
self.failUnless(str(s) == "nan", "wrong float quoting: " + str(s))
|
self.failUnless(str(s) == "nan", "wrong float quoting: " + str(s))
|
||||||
self.failUnless(type(s) == float, "wrong float conversion: " + repr(s))
|
self.failUnless(type(s) == float, "wrong float conversion: " + repr(s))
|
||||||
|
|
||||||
|
def testFloatInf(self):
|
||||||
|
try:
|
||||||
|
self.execute("select 'inf'::float")
|
||||||
|
except psycopg2.DataError:
|
||||||
|
return self.skipTest("inf::float not available on the server")
|
||||||
|
|
||||||
s = self.execute("SELECT %s AS foo", (float("inf"),))
|
s = self.execute("SELECT %s AS foo", (float("inf"),))
|
||||||
self.failUnless(str(s) == "inf", "wrong float quoting: " + str(s))
|
self.failUnless(str(s) == "inf", "wrong float quoting: " + str(s))
|
||||||
self.failUnless(type(s) == float, "wrong float conversion: " + repr(s))
|
self.failUnless(type(s) == float, "wrong float conversion: " + repr(s))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user