Skip to content
This repository was archived by the owner on Dec 21, 2025. It is now read-only.
This repository was archived by the owner on Dec 21, 2025. It is now read-only.

sqlite database connection left open on exit during testing #185

@reece

Description

@reece

Describe the bug
sqlite database connection left open

To Reproduce
Steps to reproduce the behavior:

$ make test
⋮
_____________________________________________________________________________________________________________________ coverage: platform linux, python 3.14.0-final-0 _____________________________________________________________________________________________________________________

Coverage XML written to file coverage.xml
=================================================================================================================================== 25 passed in 6.67s ====================================================================================================================================
<sys>:0: ResourceWarning: unclosed database in <sqlite3.Connection object at 0x71890108af20>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
<sys>:0: ResourceWarning: unclosed database in <sqlite3.Connection object at 0x71890108ae30>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
<sys>:0: ResourceWarning: unclosed database in <sqlite3.Connection object at 0x71890108b790>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
<sys>:0: ResourceWarning: unclosed database in <sqlite3.Connection object at 0x7189010e66b0>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
<sys>:0: ResourceWarning: unclosed database in <sqlite3.Connection object at 0x7189010e7790>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
<sys>:0: ResourceWarning: unclosed database in <sqlite3.Connection object at 0x7189010e76a0>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
<sys>:0: ResourceWarning: unclosed database in <sqlite3.Connection object at 0x7189010e73d0>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
<sys>:0: ResourceWarning: unclosed database in <sqlite3.Connection object at 0x7189010e75b0>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
<sys>:0: ResourceWarning: unclosed database in <sqlite3.Connection object at 0x71890140ae30>
ResourceWarning: Enable tracemalloc to get the object allocation traceback

Expected behavior
No warnings because sqlite database is properly closed

Additional context
Almost certainly means that we need to be using sqlite in a context manager or have an explicit close path

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions