Fixed tests to run on Windows.

This commit is contained in:
Daniele Varrazzo 2010-11-11 01:39:46 +00:00
parent 92ee893f0f
commit 11c021cb21
2 changed files with 9 additions and 1 deletions

View File

@ -87,7 +87,8 @@ conn.close()
pids[name] = int(self.notify(name).communicate()[0])
self.assertEqual(0, len(self.conn.notifies))
self.assertEqual(extensions.POLL_OK, self.conn.poll())
for i in range(10):
self.assertEqual(extensions.POLL_OK, self.conn.poll())
self.assertEqual(3, len(self.conn.notifies))
names = dict.fromkeys(['foo', 'bar', 'baz'])

View File

@ -80,6 +80,13 @@ class TypesBasicTests(unittest.TestCase):
self.failUnless(type(s) == decimal.Decimal, "wrong decimal conversion: " + repr(s))
def testFloat(self):
try:
float("nan")
except ValueError:
import warnings
warnings.warn("nan not available on this platform")
return
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))