diff options
author | Oleksandr Shulgin <oleksandr.shulgin@zalando.de> | 2015-10-14 12:50:08 +0200 |
---|---|---|
committer | Oleksandr Shulgin <oleksandr.shulgin@zalando.de> | 2015-10-14 12:50:08 +0200 |
commit | fea2260fc5ec8dda9904eed9509b1a834b05747f (patch) | |
tree | 60f375a2e06949c60dd90ad31c206fc78b99a9e3 /tests | |
parent | 54079072db3a6ff0794b8ce141e2dd929416bd14 (diff) | |
download | psycopg2-fea2260fc5ec8dda9904eed9509b1a834b05747f.tar.gz |
Fix stop_replication: always raise outside the loop.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_connection.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_connection.py b/tests/test_connection.py index 91ea51f..18f1ff3 100755 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -1197,6 +1197,18 @@ class ReplicationTest(ConnectingTestCase): cur.execute("IDENTIFY_SYSTEM") cur.fetchall() + @skip_before_postgres(9, 0) + def test_stop_replication_raises(self): + import psycopg2.extras + conn = self.repl_connect(connection_factory=psycopg2.extras.PhysicalReplicationConnection) + if conn is None: return + cur = conn.cursor() + self.assertRaises(psycopg2.ProgrammingError, cur.stop_replication) + + cur.start_replication() + self.assertRaises(psycopg2.ProgrammingError, cur.stop_replication) + + def test_suite(): return unittest.TestLoader().loadTestsFromName(__name__) |