Skip to content

Commit aba8273

Browse files
Clear env before running env resolver tests
This updates the env credential resolver tests to clear the targeted variables before any tests are run so that if they happen to be set already they don't affect the tests.
1 parent 64ff0d5 commit aba8273

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/smithy-aws-core/tests/unit/identity/test_environment_credentials_resolver.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
from smithy_core.exceptions import SmithyIdentityError
77

88

9+
@pytest.fixture(autouse=True)
10+
def clear_environment(monkeypatch: pytest.MonkeyPatch) -> None:
11+
monkeypatch.delenv("AWS_ACCOUNT_ID", raising=False)
12+
monkeypatch.delenv("AWS_SECRET_ACCESS_KEY", raising=False)
13+
monkeypatch.delenv("AWS_ACCESS_KEY_ID", raising=False)
14+
monkeypatch.delenv("AWS_SESSION_TOKEN", raising=False)
15+
16+
917
async def test_no_values_set():
1018
with pytest.raises(SmithyIdentityError):
1119
await EnvironmentCredentialsResolver().get_identity(properties={})

0 commit comments

Comments
 (0)