mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-26 02:43:43 +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:
|
||||
return self.skipTest("decimal not available")
|
||||
|
||||
def testFloat(self):
|
||||
def testFloatNan(self):
|
||||
try:
|
||||
float("nan")
|
||||
except ValueError:
|
||||
|
@ -90,6 +90,13 @@ class TypesBasicTests(unittest.TestCase):
|
|||
s = self.execute("SELECT %s AS foo", (float("nan"),))
|
||||
self.failUnless(str(s) == "nan", "wrong float quoting: " + str(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"),))
|
||||
self.failUnless(str(s) == "inf", "wrong float quoting: " + str(s))
|
||||
self.failUnless(type(s) == float, "wrong float conversion: " + repr(s))
|
||||
|
|
Loading…
Reference in New Issue
Block a user