Skip to content

Commit be337a0

Browse files
committed
tests: Disable Boto3's config and credential file parsing during tests
1 parent 376adcc commit be337a0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_stream_io.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,16 @@ def set_up_moto(*endpoints):
104104
"AWS_SECURITY_TOKEN",
105105
"AWS_SESSION_TOKEN",
106106
"AWS_DEFAULT_REGION",
107+
"AWS_CONFIG_FILE",
108+
"AWS_SHARED_CREDENTIALS_FILE",
107109
)
108110
if key in os.environ
109111
}
110112

113+
# Disable these two entirely
114+
os.environ["AWS_CONFIG_FILE"] = ""
115+
os.environ["AWS_SHARED_CREDENTIALS_FILE"] = ""
116+
111117
for key in old_environment:
112118
test_value = "us-east-1" if key == "AWS_DEFAULT_REGION" else "TEST"
113119
os.environ[key] = test_value
@@ -119,6 +125,8 @@ def set_up_moto(*endpoints):
119125

120126

121127
def tear_down_moto(old_environment):
128+
del os.environ["AWS_CONFIG_FILE"]
129+
del os.environ["AWS_SHARED_CREDENTIALS_FILE"]
122130
for key, value in old_environment:
123131
os.environ[key] = value
124132

0 commit comments

Comments
 (0)