diff --git a/tests/test_map_api.db-shm b/tests/test_map_api.db-shm deleted file mode 100644 index fe9ac28..0000000 Binary files a/tests/test_map_api.db-shm and /dev/null differ diff --git a/tests/test_map_api.db-wal b/tests/test_map_api.db-wal deleted file mode 100644 index e69de29..0000000 diff --git a/tests/test_map_api.py b/tests/test_map_api.py index fbae1d2..062983d 100644 --- a/tests/test_map_api.py +++ b/tests/test_map_api.py @@ -30,13 +30,15 @@ def clean_db(): @pytest.fixture def client(): + # Ensure isolated DB path (module-level env may be overwritten by other tests) + os.environ["CANTEEN_DB_PATH"] = str(TEST_DB) _clean_db() + import importlib + importlib.invalidate_caches() for mod in list(sys.modules.keys()): if mod == "server" or mod.startswith("server."): del sys.modules[mod] import server - import importlib - importlib.invalidate_caches() with TestClient(server.app) as tc: yield tc