mirror of https://github.com/docker/docker-py.git
Fix or noqa B003 (assigning to os.environ doesn't do what you expect)
Signed-off-by: Aarni Koskela <akx@iki.fi>
This commit is contained in:
parent
c4b5cc3629
commit
86d47b8914
|
|
@ -7,7 +7,7 @@ from unittest import mock
|
||||||
@mock.patch.dict(os.environ)
|
@mock.patch.dict(os.environ)
|
||||||
def test_create_environment_dict():
|
def test_create_environment_dict():
|
||||||
base = {'FOO': 'bar', 'BAZ': 'foobar'}
|
base = {'FOO': 'bar', 'BAZ': 'foobar'}
|
||||||
os.environ = base
|
os.environ = base # noqa: B003
|
||||||
assert create_environment_dict({'FOO': 'baz'}) == {
|
assert create_environment_dict({'FOO': 'baz'}) == {
|
||||||
'FOO': 'baz', 'BAZ': 'foobar',
|
'FOO': 'baz', 'BAZ': 'foobar',
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,8 @@ class FromEnvTest(unittest.TestCase):
|
||||||
self.os_environ = os.environ.copy()
|
self.os_environ = os.environ.copy()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
os.environ = self.os_environ
|
os.environ.clear()
|
||||||
|
os.environ.update(self.os_environ)
|
||||||
|
|
||||||
def test_from_env(self):
|
def test_from_env(self):
|
||||||
"""Test that environment variables are passed through to
|
"""Test that environment variables are passed through to
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,8 @@ class KwargsFromEnvTest(unittest.TestCase):
|
||||||
self.os_environ = os.environ.copy()
|
self.os_environ = os.environ.copy()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
os.environ = self.os_environ
|
os.environ.clear()
|
||||||
|
os.environ.update(self.os_environ)
|
||||||
|
|
||||||
def test_kwargs_from_env_empty(self):
|
def test_kwargs_from_env_empty(self):
|
||||||
os.environ.update(DOCKER_HOST='',
|
os.environ.update(DOCKER_HOST='',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue