From 5722eb59d46cf85c4086b3cfe06a929ee4d211aa Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sat, 2 Oct 2021 21:23:51 +0200 Subject: [PATCH] Print the unexpected warnings in tests --- tests/pool/test_pool.py | 2 +- tests/test_connection.py | 4 ++-- tests/test_connection_async.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) 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): -- 2.47.2