diff options
| author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-11-11 01:39:46 +0000 |
|---|---|---|
| committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-11-11 10:39:35 +0000 |
| commit | 11c021cb21f7dc33d0232b425d127023d19b1a14 (patch) | |
| tree | 3a018c8c23433cab9e94b4311537a884a638d197 | |
| parent | 92ee893f0fcd3fb49ec41ad384cd7ff4b74d294f (diff) | |
| download | psycopg2-11c021cb21f7dc33d0232b425d127023d19b1a14.tar.gz | |
Fixed tests to run on Windows.
| -rwxr-xr-x | tests/test_notify.py | 3 | ||||
| -rwxr-xr-x | tests/types_basic.py | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_notify.py b/tests/test_notify.py index 83c1061..8dd8c70 100755 --- a/tests/test_notify.py +++ b/tests/test_notify.py @@ -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']) diff --git a/tests/types_basic.py b/tests/types_basic.py index 95adc7d..aee4754 100755 --- a/tests/types_basic.py +++ b/tests/types_basic.py @@ -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)) |
