summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2015-12-21 09:46:30 +0100
committerFlorian Bruhin <git@the-compiler.org>2015-12-21 09:46:30 +0100
commit9f64dfb3b676edd48ed1c9425c398cb86ac26330 (patch)
tree87babca57e4b167e4732e3ffc157a63e74b55838
parent12f44d0a5ef4eb30e455f92c8146f821de53f9fa (diff)
downloadqutebrowser-9f64dfb3b676edd48ed1c9425c398cb86ac26330.tar.gz
qutebrowser-9f64dfb3b676edd48ed1c9425c398cb86ac26330.zip
Skip all tests using py_proc when frozen.
-rw-r--r--tests/conftest.py2
-rw-r--r--tests/unit/misc/test_guiprocess.py9
-rw-r--r--tests/unit/misc/test_ipc.py1
-rw-r--r--tests/unit/utils/test_qtutils.py1
4 files changed, 2 insertions, 11 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index fbb514cb7..407540fbe 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -341,6 +341,8 @@ def cookiejar_and_cache(stubs):
@pytest.fixture
def py_proc():
"""Get a python executable and args list which executes the given code."""
+ if getattr(sys, 'frozen', False):
+ pytest.skip("Can't be run when frozen")
def func(code):
return (sys.executable, ['-c', textwrap.dedent(code.strip('\n'))])
return func
diff --git a/tests/unit/misc/test_guiprocess.py b/tests/unit/misc/test_guiprocess.py
index ae25b5935..639fca38c 100644
--- a/tests/unit/misc/test_guiprocess.py
+++ b/tests/unit/misc/test_guiprocess.py
@@ -54,7 +54,6 @@ def fake_proc(monkeypatch, stubs):
return p
-@pytest.mark.not_frozen
def test_start(proc, qtbot, guiprocess_message_mock, py_proc):
"""Test simply starting a process."""
with qtbot.waitSignals([proc.started, proc.finished], raising=True,
@@ -66,7 +65,6 @@ def test_start(proc, qtbot, guiprocess_message_mock, py_proc):
assert bytes(proc._proc.readAll()).rstrip() == b'test'
-@pytest.mark.not_frozen
def test_start_verbose(proc, qtbot, guiprocess_message_mock, py_proc):
"""Test starting a process verbosely."""
proc.verbose = True
@@ -84,7 +82,6 @@ def test_start_verbose(proc, qtbot, guiprocess_message_mock, py_proc):
assert bytes(proc._proc.readAll()).rstrip() == b'test'
-@pytest.mark.not_frozen
def test_start_env(monkeypatch, qtbot, py_proc):
monkeypatch.setenv('QUTEBROWSER_TEST_1', '1')
env = {'QUTEBROWSER_TEST_2': '2'}
@@ -110,7 +107,6 @@ def test_start_env(monkeypatch, qtbot, py_proc):
assert 'QUTEBROWSER_TEST_2' in ret_env
-@pytest.mark.not_frozen
@pytest.mark.qt_log_ignore('QIODevice::read.*: WriteOnly device', extend=True)
def test_start_mode(proc, qtbot, py_proc):
"""Test simply starting a process with mode parameter."""
@@ -141,7 +137,6 @@ def test_start_detached_error(fake_proc, guiprocess_message_mock):
assert msg.text == "Error while spawning testprocess: Error message."
-@pytest.mark.not_frozen
def test_double_start(qtbot, proc, py_proc):
"""Test starting a GUIProcess twice."""
with qtbot.waitSignal(proc.started, raising=True, timeout=10000):
@@ -151,7 +146,6 @@ def test_double_start(qtbot, proc, py_proc):
proc.start('', [])
-@pytest.mark.not_frozen
def test_double_start_finished(qtbot, proc, py_proc):
"""Test starting a GUIProcess twice (with the first call finished)."""
with qtbot.waitSignals([proc.started, proc.finished], raising=True,
@@ -196,7 +190,6 @@ def test_error(qtbot, proc, caplog, guiprocess_message_mock):
assert msg.text == expected_msg
-@pytest.mark.not_frozen
def test_exit_unsuccessful(qtbot, proc, guiprocess_message_mock, py_proc):
with qtbot.waitSignal(proc.finished, raising=True, timeout=10000):
proc.start(*py_proc('import sys; sys.exit(1)'))
@@ -205,7 +198,6 @@ def test_exit_unsuccessful(qtbot, proc, guiprocess_message_mock, py_proc):
assert msg.text == "Testprocess exited with status 1."
-@pytest.mark.not_frozen
@pytest.mark.parametrize('stream', ['stdout', 'stderr'])
def test_exit_unsuccessful_output(qtbot, proc, caplog, py_proc, stream):
"""When a process fails, its output should be logged."""
@@ -220,7 +212,6 @@ def test_exit_unsuccessful_output(qtbot, proc, caplog, py_proc, stream):
assert caplog.records[1].msg == 'Process {}:\ntest'.format(stream)
-@pytest.mark.not_frozen
@pytest.mark.parametrize('stream', ['stdout', 'stderr'])
def test_exit_successful_output(qtbot, proc, py_proc, stream):
"""When a process suceeds, no output should be logged.
diff --git a/tests/unit/misc/test_ipc.py b/tests/unit/misc/test_ipc.py
index 2a0af8622..b60b31cab 100644
--- a/tests/unit/misc/test_ipc.py
+++ b/tests/unit/misc/test_ipc.py
@@ -693,7 +693,6 @@ class TestSendOrListen:
assert "Connecting to {}".format(legacy_server._socketname) in msgs
@pytest.mark.posix(reason="Unneeded on Windows")
- @pytest.mark.not_frozen
def test_stale_legacy_server(self, caplog, qtbot, args, legacy_server,
ipc_server, py_proc):
legacy_name = ipc._get_socketname(args.basedir, legacy=True)
diff --git a/tests/unit/utils/test_qtutils.py b/tests/unit/utils/test_qtutils.py
index b2d733423..0e8575c15 100644
--- a/tests/unit/utils/test_qtutils.py
+++ b/tests/unit/utils/test_qtutils.py
@@ -760,7 +760,6 @@ class TestPyQIODevice:
with pytest.raises(io.UnsupportedOperation):
pyqiodev.seek(0, whence)
- @pytest.mark.not_frozen
def test_qprocess(self, py_proc):
"""Test PyQIODevice with a QProcess which is non-sequential.