1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-10-30 06:34:09 +00:00

#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

View File

@@ -56,7 +56,13 @@ def set_shell(monkeypatch, request):
def _set(cls):
shell = cls()
monkeypatch.setattr('thefuck.shells.shell', shell)
request.addfinalizer()
return shell
return _set
@pytest.fixture(autouse=True)
def os_environ(monkeypatch):
env = {'PATH': ''}
monkeypatch.setattr('os.environ', env)
return env