summaryrefslogtreecommitdiff
path: root/tests/helpers
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-03-29 11:51:10 +0200
committerFlorian Bruhin <me@the-compiler.org>2021-03-29 23:42:14 +0200
commitd31d63cc684b804f44768928cbb6df310f06ab1d (patch)
treefa3a5c81c5d7d2d59f9947f02c25d5b06dcab7f7 /tests/helpers
parenteee6e6180e3b75f23059909d52983572c8477f06 (diff)
downloadqutebrowser-d31d63cc684b804f44768928cbb6df310f06ab1d.tar.gz
qutebrowser-d31d63cc684b804f44768928cbb6df310f06ab1d.zip
tests: Move freezer to fixtures.py
Diffstat (limited to 'tests/helpers')
-rw-r--r--tests/helpers/fixtures.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py
index 4e0204741..89386a1a5 100644
--- a/tests/helpers/fixtures.py
+++ b/tests/helpers/fixtures.py
@@ -42,6 +42,7 @@ from PyQt5.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout
from PyQt5.QtNetwork import QNetworkCookieJar
import helpers.stubs as stubsmod
+import qutebrowser
from qutebrowser.config import (config, configdata, configtypes, configexc,
configfiles, configcache, stylesheet)
from qutebrowser.api import config as configapi
@@ -736,3 +737,14 @@ def webengine_versions(testdata_scheme):
"""
pytest.importorskip('PyQt5.QtWebEngineWidgets')
return version.qtwebengine_versions()
+
+
+@pytest.fixture(params=[True, False])
+def freezer(request, monkeypatch):
+ 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!")
+ return request.param