From 5bc287b51411b6058911658251b1b2028d16e467 Mon Sep 17 00:00:00 2001 From: Anton Zuev Date: Tue, 12 Nov 2024 15:27:31 +0300 Subject: [PATCH] Update tests\bugs\core_5845_test.py: Made the test more reliable. Perform prepare using the with manager to avoid uncontrolled deletion of the Statement object. --- tests/bugs/core_5845_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/bugs/core_5845_test.py b/tests/bugs/core_5845_test.py index 309e4a8c..0d4e976a 100644 --- a/tests/bugs/core_5845_test.py +++ b/tests/bugs/core_5845_test.py @@ -88,9 +88,9 @@ def test_1(act: Action, capsys): with act.db.connect() as con: cur = con.cursor() for q in chk_qry_map.keys(): - ps = cur.prepare(q) - print( q ) - print( ps.plan ) + with cur.prepare(q) as ps: + print( q ) + print( ps.plan ) act.expected_stdout = '\n'.join(expected_plans_lst) act.stdout = capsys.readouterr().out