diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-11-19 03:55:37 +0000 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-11-19 03:55:37 +0000 |
commit | 19ead4a5cb0dcefadb604c872e9f2b93430747f6 (patch) | |
tree | 36d2cb98f1fcf5dfa018aae577dd7060c887990d /tests/test_notify.py | |
parent | 94348bfb78cc2576d586b5f1e6fde3e10c14b178 (diff) | |
download | psycopg2-19ead4a5cb0dcefadb604c872e9f2b93430747f6.tar.gz |
Test cleanup.
Tests pass or fail gracefully on older PostgreSQL versions.
If unittest2 is available, skip tests instead of printing warnings.
Diffstat (limited to 'tests/test_notify.py')
-rwxr-xr-x | tests/test_notify.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/test_notify.py b/tests/test_notify.py index 8dd8c70..75dae1e 100755 --- a/tests/test_notify.py +++ b/tests/test_notify.py @@ -1,6 +1,5 @@ #!/usr/bin/env python -import unittest -import warnings +from testutils import unittest import psycopg2 from psycopg2 import extensions @@ -127,9 +126,8 @@ conn.close() def test_notify_payload(self): if self.conn.server_version < 90000: - warnings.warn("server version %s doesn't support notify payload: skipping test" + return self.skipTest("server version %s doesn't support notify payload" % self.conn.server_version) - return self.autocommit(self.conn) self.listen('foo') pid = int(self.notify('foo', payload="Hello, world!").communicate()[0]) |