In-process fixture moves to the root conftest (a tests conftest shadowed it)

This commit is contained in:
Roberto Treviño
2026-11-28 10:26:24 -06:00
parent b515746406
commit 052fb23fab
-20
View File
@@ -1,20 +0,0 @@
"""In-process API tests: a platform of their own (never the deployed data folder)."""
import pytest
from webapi import sources, users
@pytest.fixture
def own_platform(tmp_path, monkeypatch):
"""The API's data folder, platform database and sign-in in tmp_path."""
monkeypatch.setenv("ISSSTELEON_DATA", str(tmp_path))
monkeypatch.setattr(sources, "DATA_DIR", tmp_path)
monkeypatch.setattr(users, "DATA_DIR", tmp_path)
monkeypatch.setenv("PLATFORM_DATABASE_URL", f"sqlite:///{tmp_path / 'platform.db'}")
monkeypatch.delenv("AUTH_SECRET", raising=False)
users._engine.cache_clear()
users._secret.cache_clear()
yield tmp_path
users._engine.cache_clear()
users._secret.cache_clear()