Skip to content

Commit e142b2a

Browse files
committed
fix(tests): Fix an isolation issue between tests and GITGUARDIAN_PERSONAL_ACCESS_TOKEN env variable
Issue: #
1 parent c79d671 commit e142b2a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ def mock_gitguardian_client():
6060
@pytest.fixture(autouse=True)
6161
def mock_env_vars():
6262
"""Automatically mock environment variables for all tests."""
63-
with patch.dict(os.environ, {"GITGUARDIAN_URL": "https://test.api.gitguardian.com"}):
63+
env_overrides = {
64+
"GITGUARDIAN_URL": "https://test.api.gitguardian.com",
65+
"GITGUARDIAN_PERSONAL_ACCESS_TOKEN": "", # Clear PAT to test OAuth paths
66+
}
67+
with patch.dict(os.environ, env_overrides):
6468
yield
6569

6670

0 commit comments

Comments
 (0)