Skip to content

Commit 24bf7e5

Browse files
samm81WhyNotHugo
authored andcommitted
updates SqliteStatus to properly close connections
otherwise, when trying to run `pytest` in a `python3.13` environment results in a bunch of ``` tests/unit/sync/test_sync.py::test_partial_sync_ignore /home/user/.asdf/installs/python/3.13.1/lib/python3.13/asyncio/base_events.py:650: ResourceWarning: unclosed database in <sqlite3.Connection object at 0x7fda8f6b6c50> sys.set_asyncgen_hooks( Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. ```
1 parent 60379c6 commit 24bf7e5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

vdirsyncer/sync/status.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,14 @@ def _update_schema(self):
169169
); """
170170
)
171171

172+
def close(self):
173+
if self._c:
174+
self._c.close()
175+
self._c = None
176+
177+
def __del__(self):
178+
self.close()
179+
172180
def _is_latest_version(self):
173181
try:
174182
return bool(

0 commit comments

Comments
 (0)