From: Denis Laxalde Date: Sun, 27 Mar 2022 16:02:53 +0000 (+0200) Subject: test: do not catch OperationalError in test_pipeline_errors_processed_at_exit X-Git-Tag: 3.1~146^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f0c1caf6df3386445e5102b33569be82fe05f70;p=thirdparty%2Fpsycopg.git test: do not catch OperationalError in test_pipeline_errors_processed_at_exit Co-authored-by: Daniele Varrazzo --- diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py index a19e4bdae..0079aa66c 100644 --- a/tests/test_pipeline.py +++ b/tests/test_pipeline.py @@ -72,7 +72,7 @@ def test_pipeline_processed_at_exit(conn): def test_pipeline_errors_processed_at_exit(conn): conn.autocommit = True - with pytest.raises((e.OperationalError, e.UndefinedTable)): + with pytest.raises(e.UndefinedTable): with conn.pipeline(): conn.execute("select * from nosuchtable") conn.execute("create table voila ()") diff --git a/tests/test_pipeline_async.py b/tests/test_pipeline_async.py index bd079c925..c306d63c8 100644 --- a/tests/test_pipeline_async.py +++ b/tests/test_pipeline_async.py @@ -75,7 +75,7 @@ async def test_pipeline_processed_at_exit(aconn): async def test_pipeline_errors_processed_at_exit(aconn): await aconn.set_autocommit(True) - with pytest.raises((e.OperationalError, e.UndefinedTable)): + with pytest.raises(e.UndefinedTable): async with aconn.pipeline(): await aconn.execute("select * from nosuchtable") await aconn.execute("create table voila ()")