From 5d33b39829d9733aa322246e12e2078a18d283b5 Mon Sep 17 00:00:00 2001 From: Oleksandr Shulgin Date: Thu, 21 Jan 2016 15:56:27 +0100 Subject: [PATCH] Fix error test for invalid START_REPLICATION command. --- tests/test_replication.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_replication.py b/tests/test_replication.py index a316135f..f527edd2 100644 --- a/tests/test_replication.py +++ b/tests/test_replication.py @@ -126,8 +126,14 @@ class ReplicationTest(ReplicationTestCase): self.create_replication_slot(cur, output_plugin='test_decoding') - self.assertRaises(psycopg2.DataError, cur.start_replication, - slot_name=self.slot, options=dict(invalid_param='value')) + # try with invalid options + cur.start_replication(slot_name=self.slot, options={'invalid_param': 'value'}) + def consume(msg): + pass + # we don't see the error from the server before we try to read the data + self.assertRaises(psycopg2.DataError, cur.consume_stream, consume) + + # try with correct command cur.start_replication(slot_name=self.slot) @skip_before_postgres(9, 4) # slots require 9.4