Fix TestReadFile when frozen.

This commit is contained in:
Florian Bruhin 2015-06-19 07:15:25 +02:00
parent 85f6b3c6df
commit a5610fd6da

View File

@ -98,9 +98,12 @@ class TestReadFile:
@pytest.fixture(autouse=True, params=[True, False])
def freezer(self, request, monkeypatch):
if request.param:
if request.param and not getattr(sys, 'frozen', False):
monkeypatch.setattr(sys, 'frozen', True, raising=False)
monkeypatch.setattr('sys.executable', qutebrowser.__file__)
elif not request.param and getattr(sys, 'frozen', False):
# Want to test unfrozen tests, but we are frozen
pytest.skip("Can't run with sys.frozen = True!")
def test_readfile(self):
"""Read a test file."""