Skip to content

Commit

Permalink
Fix or noqa B003 (assigning to os.environ doesn't do what you expect)
Browse files Browse the repository at this point in the history
Signed-off-by: Aarni Koskela <[email protected]>
  • Loading branch information
akx committed Jun 6, 2023
1 parent c4b5cc3 commit 86d47b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/integration/credentials/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@mock.patch.dict(os.environ)
def test_create_environment_dict():
base = {'FOO': 'bar', 'BAZ': 'foobar'}
os.environ = base
os.environ = base # noqa: B003
assert create_environment_dict({'FOO': 'baz'}) == {
'FOO': 'baz', 'BAZ': 'foobar',
}
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ def setUp(self):
self.os_environ = os.environ.copy()

def tearDown(self):
os.environ = self.os_environ
os.environ.clear()
os.environ.update(self.os_environ)

def test_from_env(self):
"""Test that environment variables are passed through to
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def setUp(self):
self.os_environ = os.environ.copy()

def tearDown(self):
os.environ = self.os_environ
os.environ.clear()
os.environ.update(self.os_environ)

def test_kwargs_from_env_empty(self):
os.environ.update(DOCKER_HOST='',
Expand Down

0 comments on commit 86d47b8

Please sign in to comment.