From: Daniele Varrazzo Date: Sat, 2 Oct 2021 19:23:51 +0000 (+0200) Subject: Print the unexpected warnings in tests X-Git-Tag: 3.0~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5722eb59d46cf85c4086b3cfe06a929ee4d211aa;p=thirdparty%2Fpsycopg.git Print the unexpected warnings in tests --- diff --git a/tests/pool/test_pool.py b/tests/pool/test_pool.py index 5700d458c..6c0f9374d 100644 --- a/tests/pool/test_pool.py +++ b/tests/pool/test_pool.py @@ -573,7 +573,7 @@ def test_del_no_warning(dsn, recwarn): ref = weakref.ref(p) del p assert not ref() - assert not recwarn + assert not recwarn, [str(w.message) for w in recwarn.list] @pytest.mark.slow diff --git a/tests/test_connection.py b/tests/test_connection.py index 3e7070182..7faae5dd4 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -93,7 +93,7 @@ def test_connection_warn_close(dsn, recwarn): conn = Connection.connect(dsn) conn.close() del conn - assert not recwarn + assert not recwarn, [str(w.message) for w in recwarn.list] conn = Connection.connect(dsn) del conn @@ -115,7 +115,7 @@ def test_connection_warn_close(dsn, recwarn): with Connection.connect(dsn) as conn: pass del conn - assert not recwarn + assert not recwarn, [str(w.message) for w in recwarn.list] def test_context_commit(conn, dsn): diff --git a/tests/test_connection_async.py b/tests/test_connection_async.py index 2db77fc96..f6be5f463 100644 --- a/tests/test_connection_async.py +++ b/tests/test_connection_async.py @@ -100,7 +100,7 @@ async def test_connection_warn_close(dsn, recwarn): conn = await AsyncConnection.connect(dsn) await conn.close() del conn - assert not recwarn + assert not recwarn, [str(w.message) for w in recwarn.list] conn = await AsyncConnection.connect(dsn) del conn @@ -122,7 +122,7 @@ async def test_connection_warn_close(dsn, recwarn): async with await AsyncConnection.connect(dsn) as conn: pass del conn - assert not recwarn + assert not recwarn, [str(w.message) for w in recwarn.list] async def test_context_commit(aconn, dsn):