summaryrefslogtreecommitdiff
path: root/tests/helpers/fixtures.py
diff options
context:
space:
mode:
authorlufte <javier@lufte.net>2021-06-30 21:00:43 -0300
committerlufte <javier@lufte.net>2021-06-30 21:00:43 -0300
commit748c686bf002822c6031565780e46ee8a378cc8e (patch)
tree9ceaf5b6fbf6a50ee0f1aceaf0484795c4d811ba /tests/helpers/fixtures.py
parentf7cc5ff3fcdab78e0e0696c5111294ed1ebd7724 (diff)
downloadqutebrowser-748c686bf002822c6031565780e46ee8a378cc8e.tar.gz
qutebrowser-748c686bf002822c6031565780e46ee8a378cc8e.zip
Fix history unit tests
Diffstat (limited to 'tests/helpers/fixtures.py')
-rw-r--r--tests/helpers/fixtures.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py
index 7106698be..3426e18b2 100644
--- a/tests/helpers/fixtures.py
+++ b/tests/helpers/fixtures.py
@@ -639,15 +639,6 @@ def short_tmpdir():
yield py.path.local(tdir) # pylint: disable=no-member
-@pytest.fixture
-def init_sql(data_tmpdir):
- """Initialize the SQL module, and shut it down after the test."""
- path = str(data_tmpdir / 'test.db')
- sql.init(path)
- yield
- sql.close()
-
-
class ModelValidator:
"""Validates completion models."""
@@ -682,12 +673,13 @@ def download_stub(win_registry, tmpdir, stubs):
@pytest.fixture
-def web_history(fake_save_manager, tmpdir, init_sql, config_stub, stubs,
+def web_history(fake_save_manager, tmpdir, data_tmpdir, config_stub, stubs,
monkeypatch):
"""Create a WebHistory object."""
config_stub.val.completion.timestamp_format = '%Y-%m-%d'
config_stub.val.completion.web_history.max_items = -1
- web_history = history.WebHistory(stubs.FakeHistoryProgress())
+ db = sql.Database(str(data_tmpdir / 'history.db'))
+ web_history = history.WebHistory(db, stubs.FakeHistoryProgress())
monkeypatch.setattr(history, 'web_history', web_history)
return web_history