From f396c6fe671ae86402eb35f352fb1eee07493c87 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 6 Dec 2022 17:06:56 +0100 Subject: tests: Make sure we close history database connections With pytest main, pytest now reuses temporary directories... --- tests/unit/completion/test_histcategory.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/completion/test_histcategory.py b/tests/unit/completion/test_histcategory.py index cb37fb784..648017cf0 100644 --- a/tests/unit/completion/test_histcategory.py +++ b/tests/unit/completion/test_histcategory.py @@ -36,7 +36,8 @@ def hist(data_tmpdir, config_stub): db = sql.Database(str(data_tmpdir / 'test_histcategory.db')) config_stub.val.completion.timestamp_format = '%Y-%m-%d' config_stub.val.completion.web_history.max_items = -1 - return sql.SqlTable(db, 'CompletionHistory', ['url', 'title', 'last_atime']) + yield sql.SqlTable(db, 'CompletionHistory', ['url', 'title', 'last_atime']) + db.close() # pytest could re-use the filename @pytest.mark.parametrize('pattern, before, after', [ -- cgit v1.2.3-54-g00ecf