Skip to content

Commit cad9d01

Browse files
authored
Merge pull request #531 from smithy-lang/make-env-tests-more-robust
Clear env before running env resolver tests
2 parents 64ff0d5 + aba8273 commit cad9d01

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)