]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
test: do not catch OperationalError in test_pipeline_errors_processed_at_exit
authorDenis Laxalde <denis@laxalde.org>
Sun, 27 Mar 2022 16:02:53 +0000 (18:02 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 2 Apr 2022 23:17:57 +0000 (01:17 +0200)
Co-authored-by: Daniele Varrazzo <daniele.varrazzo@gmail.com>
tests/test_pipeline.py
tests/test_pipeline_async.py

index a19e4bdae99711cca91d6332519e450b9264da26..0079aa66cf9b94dfd02814eee352eda22c042f90 100644 (file)
@@ -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 ()")
index bd079c925203c34643189315c3583ba58598abed..c306d63c835d9459053de087829a12afded63002 100644 (file)
@@ -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 ()")