aboutsummaryrefslogtreecommitdiff
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2023-11-25 11:07:59 +0100
committerDaniel Schadt <kingdread@gmx.de>2023-11-25 11:07:59 +0100
commit6e6a5a836dd1bd567078896a9e75d93061fd13a6 (patch)
tree45000737a4f18a99397f793a2cd1ad2a42d3002f /tests/conftest.py
parent40779bcfea8fce9a23c552cf449d25a0971ee329 (diff)
parentac2eea33e8e2b03a0c4c1c170e6141355bef01a5 (diff)
downloadfietsboek-6e6a5a836dd1bd567078896a9e75d93061fd13a6.tar.gz
fietsboek-6e6a5a836dd1bd567078896a9e75d93061fd13a6.tar.bz2
fietsboek-6e6a5a836dd1bd567078896a9e75d93061fd13a6.zip
Merge branch 'disable-image-upload'
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index a4366ab..94f795a 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -28,11 +28,14 @@ def ini_file(request):
# potentially grab this path from a pytest option
return os.path.abspath(request.config.option.ini or 'testing.ini')
-@pytest.fixture(scope='session')
+# Even though the ini file is scoped to session, we scope the actual settings
+# to module only. This way, we can test different configurations in different
+# modules.
+@pytest.fixture(scope='module')
def app_settings(ini_file):
return get_appsettings(ini_file)
-@pytest.fixture(scope='session')
+@pytest.fixture(scope='module')
def dbengine(app_settings, ini_file):
engine = models.get_engine(app_settings)
@@ -73,7 +76,7 @@ def _cleanup_data(app_settings):
if (data_dir / "tracks").is_dir():
shutil.rmtree(data_dir / "tracks")
-@pytest.fixture(scope='session')
+@pytest.fixture(scope='module')
def app(app_settings, dbengine, tmp_path_factory):
app_settings["fietsboek.data_dir"] = str(tmp_path_factory.mktemp("data"))
logging.getLogger().setLevel(logging.DEBUG)