mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
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.
```
This commit is contained in:
parent
9bbb7fa91a
commit
2c6dc4cddf
1 changed files with 8 additions and 0 deletions
|
|
@ -169,6 +169,14 @@ class SqliteStatus(_StatusBase):
|
||||||
); """
|
); """
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def close(self):
|
||||||
|
if self._c:
|
||||||
|
self._c.close()
|
||||||
|
self._c = None
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
self.close()
|
||||||
|
|
||||||
def _is_latest_version(self):
|
def _is_latest_version(self):
|
||||||
try:
|
try:
|
||||||
return bool(
|
return bool(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue