From 9d175316ffd834a2541d3ca322acbd1f68cdcc4d Mon Sep 17 00:00:00 2001 From: holger krekel Date: Sat, 21 Oct 2023 01:32:36 +0200 Subject: [PATCH] formatting and fixture move --- tests/chatmaild/conftest.py | 11 +++++++++++ tests/chatmaild/test_dictproxy.py | 9 +-------- 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 tests/chatmaild/conftest.py diff --git a/tests/chatmaild/conftest.py b/tests/chatmaild/conftest.py new file mode 100644 index 00000000..5e22e19f --- /dev/null +++ b/tests/chatmaild/conftest.py @@ -0,0 +1,11 @@ + +import pytest +from chatmaild.database import Database + + +@pytest.fixture() +def db(tmpdir): + db_path = tmpdir / "passdb.sqlite" + print("database path:", db_path) + return Database(db_path) + diff --git a/tests/chatmaild/test_dictproxy.py b/tests/chatmaild/test_dictproxy.py index 85575c76..ee88f13a 100644 --- a/tests/chatmaild/test_dictproxy.py +++ b/tests/chatmaild/test_dictproxy.py @@ -4,14 +4,7 @@ import pytest import chatmaild.dictproxy from chatmaild.dictproxy import get_user_data, lookup_passdb -from chatmaild.database import Database, DBError - - -@pytest.fixture() -def db(tmpdir): - db_path = tmpdir / "passdb.sqlite" - print("database path:", db_path) - return Database(db_path) +from chatmaild.database import DBError def test_basic(db, tmpdir, monkeypatch):