summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2022-12-06 17:06:56 +0100
committerFlorian Bruhin <me@the-compiler.org>2022-12-06 17:06:56 +0100
commitf396c6fe671ae86402eb35f352fb1eee07493c87 (patch)
treee5f644fb87db68639ff443b0a3a35574ecb11f8f
parent7b90fd37378853ed47153463298db66a3a98ecac (diff)
downloadqutebrowser-f396c6fe671ae86402eb35f352fb1eee07493c87.tar.gz
qutebrowser-f396c6fe671ae86402eb35f352fb1eee07493c87.zip
tests: Make sure we close history database connections
With pytest main, pytest now reuses temporary directories...
-rw-r--r--tests/unit/completion/test_histcategory.py3
1 files changed, 2 insertions, 1 deletions
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', [