From 971e85803f9500e59dddce0dd8a233a8ea700bbe Mon Sep 17 00:00:00 2001 From: Dmitry <47507037+DmEye@users.noreply.github.com> Date: Tue, 10 Mar 2026 11:23:44 +0300 Subject: [PATCH] Add test case for cleanup resources. --- tests/test_statement.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_statement.py b/tests/test_statement.py index ae7186e..a3450c4 100644 --- a/tests/test_statement.py +++ b/tests/test_statement.py @@ -69,3 +69,9 @@ def test_wrong_cursor(two_connections): with pytest.raises(InterfaceError, match='Cannot execute Statement that was created by different Connection.'): cur2.execute(ps) + +def test_cleanup(two_connections): + con, _ = two_connections + with con.cursor() as cur: + with cur.prepare('select * from country') as ps: + cur.execute(ps)