From 4832a0d69b91e2e9f084c768386e9b045f3232e3 Mon Sep 17 00:00:00 2001 From: bronsen Date: Sun, 22 Feb 2026 19:05:37 +0100 Subject: [PATCH] codestyle: move "statement" out of `with` block --- tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests.py b/tests.py index 1f0e1d9..844823e 100644 --- a/tests.py +++ b/tests.py @@ -180,11 +180,12 @@ async def test_data_provided_to_addtodatabase_ends_up_in_database(app_db: Engine async def test_created_database_contains_expected_tables(engine: Engine): + statement = text("SELECT name from sqlite_schema WHERE type = 'table'") with engine.connect() as connection: - statement = text("SELECT name from sqlite_schema WHERE type = 'table'") results = connection.execute(statement).all() assert len(results) == 0 create_db_and_tables(engine) + results = connection.execute(statement).all() assert len(results) == 1