#N/A: Reset environment variables in tests

This commit is contained in:
Vladimir Iakovlev
2017-08-03 12:18:05 +02:00
parent 2bbba9a0c8
commit 754bb3e21f
6 changed files with 30 additions and 38 deletions
+2 -3
View File
@@ -115,11 +115,10 @@ class TestCommand(object):
@pytest.fixture(autouse=True)
def prepare(self, monkeypatch):
monkeypatch.setattr('thefuck.types.os.environ', {})
monkeypatch.setattr('thefuck.types.Command._wait_output',
staticmethod(lambda *_: True))
def test_from_script_calls(self, Popen, settings):
def test_from_script_calls(self, Popen, settings, os_environ):
settings.env = {}
assert Command.from_raw_script(
['apt-get', 'search', 'vim']) == Command(
@@ -129,7 +128,7 @@ class TestCommand(object):
stdin=PIPE,
stdout=PIPE,
stderr=PIPE,
env={})
env=os_environ)
@pytest.mark.parametrize('script, result', [
([''], None),