Skip to content

Commit

Permalink
Run garbage collection before asserting SQLite database is cleared in…
Browse files Browse the repository at this point in the history
… test
  • Loading branch information
zanieb committed Aug 28, 2023
1 parent d653b31 commit 1d30e39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -1585,6 +1585,9 @@ async def test_should_remove_ref_on_disconnect():
values = {"text": "example1", "completed": True}
await database.execute(query, values)

# Run garbage collection to reset the database if we dropped the reference
gc.collect()

async with Database("sqlite:///file::memory:?cache=shared", uri=True) as database:
query = notes.select()
with pytest.raises(sqlite3.OperationalError):
Expand Down

0 comments on commit 1d30e39

Please sign in to comment.