Skip to content

Commit 7b73493

Browse files
committed
Add unset_env_vars fxture to ignore FASTAPI_CLOUD_TOKEN set on host in tests
1 parent 4a7422c commit 7b73493

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
from .utils import create_jwt_token
1515

1616

17+
@pytest.fixture(autouse=True)
18+
def unset_env_vars(monkeypatch: pytest.MonkeyPatch) -> Generator[None, None, None]:
19+
"""Fixture to unset environment variables that might interfere with tests."""
20+
monkeypatch.delenv("FASTAPI_CLOUD_TOKEN", raising=False)
21+
yield
22+
23+
1724
@pytest.fixture(autouse=True)
1825
def isolated_config_path() -> Generator[Path, None, None]:
1926
with tempfile.TemporaryDirectory() as tmpdir:

0 commit comments

Comments
 (0)