diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2016-12-25 17:46:11 +0100 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2016-12-25 18:30:27 +0100 |
commit | b73115ac41559c31fc3a2a3fdb0893046c08d1a5 (patch) | |
tree | ce1343fe7753dfffaca319eda8885eac48eaa9f5 /tests/testutils.py | |
parent | e27579292aff953dacdc1892f00dc32bb73a29c1 (diff) | |
download | psycopg2-b73115ac41559c31fc3a2a3fdb0893046c08d1a5.tar.gz |
Added test to verify bug #482
Diffstat (limited to 'tests/testutils.py')
-rw-r--r-- | tests/testutils.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/testutils.py b/tests/testutils.py index 1dd0c99..9347735 100644 --- a/tests/testutils.py +++ b/tests/testutils.py @@ -130,8 +130,17 @@ class ConnectingTestCase(unittest.TestCase): import psycopg2 try: conn = self.connect(**kwargs) + if conn.async == 1: + self.wait(conn) except psycopg2.OperationalError, e: - return self.skipTest("replication db not configured: %s" % e) + # If pgcode is not set it is a genuine connection error + # Otherwise we tried to run some bad operation in the connection + # (e.g. bug #482) and we'd rather know that. + if e.pgcode is None: + return self.skipTest("replication db not configured: %s" % e) + else: + raise + return conn def _get_conn(self): |