From eac4f7a7f7fec9585a7c080400c4ae8fa9b67578 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Mon, 13 Nov 2023 18:35:03 +0100 Subject: make test app fixture module-scoped Previously, we had it session-scoped, which meant that the app was created once for all tests. This doesn't allow us to play with different settings however, such as disabling account registration or image uploads and testing that. Now, the fixtures are module scoped, which means that we still save on prepare/teardown time a bit, but we're also a bit more flexible. By making new test modules, we can test different settings there. --- tests/playwright/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/playwright') diff --git a/tests/playwright/conftest.py b/tests/playwright/conftest.py index 12a0047..4e7f5a4 100644 --- a/tests/playwright/conftest.py +++ b/tests/playwright/conftest.py @@ -15,7 +15,7 @@ from fietsboek.config import Config import pytest -@pytest.fixture(scope="session") +@pytest.fixture(scope="module") def server_port(): """Return a (likely) free port. @@ -29,7 +29,7 @@ def server_port(): return port -@pytest.fixture(scope="session", autouse=True) +@pytest.fixture(scope="module", autouse=True) def running_server(server_port, app): """Have the app running as an actual server.""" server = simple_server.make_server("127.0.0.1", server_port, app) -- cgit v1.2.3