codestyle: move "statement" out of with block
This commit is contained in:
parent
1fdf5cb1d3
commit
4832a0d69b
1 changed files with 2 additions and 1 deletions
3
tests.py
3
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue