Skip all tests using py_proc when frozen.
This commit is contained in:
parent
12f44d0a5e
commit
9f64dfb3b6
@ -341,6 +341,8 @@ def cookiejar_and_cache(stubs):
|
|||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def py_proc():
|
def py_proc():
|
||||||
"""Get a python executable and args list which executes the given code."""
|
"""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):
|
def func(code):
|
||||||
return (sys.executable, ['-c', textwrap.dedent(code.strip('\n'))])
|
return (sys.executable, ['-c', textwrap.dedent(code.strip('\n'))])
|
||||||
return func
|
return func
|
||||||
|
@ -54,7 +54,6 @@ def fake_proc(monkeypatch, stubs):
|
|||||||
return p
|
return p
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.not_frozen
|
|
||||||
def test_start(proc, qtbot, guiprocess_message_mock, py_proc):
|
def test_start(proc, qtbot, guiprocess_message_mock, py_proc):
|
||||||
"""Test simply starting a process."""
|
"""Test simply starting a process."""
|
||||||
with qtbot.waitSignals([proc.started, proc.finished], raising=True,
|
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'
|
assert bytes(proc._proc.readAll()).rstrip() == b'test'
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.not_frozen
|
|
||||||
def test_start_verbose(proc, qtbot, guiprocess_message_mock, py_proc):
|
def test_start_verbose(proc, qtbot, guiprocess_message_mock, py_proc):
|
||||||
"""Test starting a process verbosely."""
|
"""Test starting a process verbosely."""
|
||||||
proc.verbose = True
|
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'
|
assert bytes(proc._proc.readAll()).rstrip() == b'test'
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.not_frozen
|
|
||||||
def test_start_env(monkeypatch, qtbot, py_proc):
|
def test_start_env(monkeypatch, qtbot, py_proc):
|
||||||
monkeypatch.setenv('QUTEBROWSER_TEST_1', '1')
|
monkeypatch.setenv('QUTEBROWSER_TEST_1', '1')
|
||||||
env = {'QUTEBROWSER_TEST_2': '2'}
|
env = {'QUTEBROWSER_TEST_2': '2'}
|
||||||
@ -110,7 +107,6 @@ def test_start_env(monkeypatch, qtbot, py_proc):
|
|||||||
assert 'QUTEBROWSER_TEST_2' in ret_env
|
assert 'QUTEBROWSER_TEST_2' in ret_env
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.not_frozen
|
|
||||||
@pytest.mark.qt_log_ignore('QIODevice::read.*: WriteOnly device', extend=True)
|
@pytest.mark.qt_log_ignore('QIODevice::read.*: WriteOnly device', extend=True)
|
||||||
def test_start_mode(proc, qtbot, py_proc):
|
def test_start_mode(proc, qtbot, py_proc):
|
||||||
"""Test simply starting a process with mode parameter."""
|
"""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."
|
assert msg.text == "Error while spawning testprocess: Error message."
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.not_frozen
|
|
||||||
def test_double_start(qtbot, proc, py_proc):
|
def test_double_start(qtbot, proc, py_proc):
|
||||||
"""Test starting a GUIProcess twice."""
|
"""Test starting a GUIProcess twice."""
|
||||||
with qtbot.waitSignal(proc.started, raising=True, timeout=10000):
|
with qtbot.waitSignal(proc.started, raising=True, timeout=10000):
|
||||||
@ -151,7 +146,6 @@ def test_double_start(qtbot, proc, py_proc):
|
|||||||
proc.start('', [])
|
proc.start('', [])
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.not_frozen
|
|
||||||
def test_double_start_finished(qtbot, proc, py_proc):
|
def test_double_start_finished(qtbot, proc, py_proc):
|
||||||
"""Test starting a GUIProcess twice (with the first call finished)."""
|
"""Test starting a GUIProcess twice (with the first call finished)."""
|
||||||
with qtbot.waitSignals([proc.started, proc.finished], raising=True,
|
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
|
assert msg.text == expected_msg
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.not_frozen
|
|
||||||
def test_exit_unsuccessful(qtbot, proc, guiprocess_message_mock, py_proc):
|
def test_exit_unsuccessful(qtbot, proc, guiprocess_message_mock, py_proc):
|
||||||
with qtbot.waitSignal(proc.finished, raising=True, timeout=10000):
|
with qtbot.waitSignal(proc.finished, raising=True, timeout=10000):
|
||||||
proc.start(*py_proc('import sys; sys.exit(1)'))
|
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."
|
assert msg.text == "Testprocess exited with status 1."
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.not_frozen
|
|
||||||
@pytest.mark.parametrize('stream', ['stdout', 'stderr'])
|
@pytest.mark.parametrize('stream', ['stdout', 'stderr'])
|
||||||
def test_exit_unsuccessful_output(qtbot, proc, caplog, py_proc, stream):
|
def test_exit_unsuccessful_output(qtbot, proc, caplog, py_proc, stream):
|
||||||
"""When a process fails, its output should be logged."""
|
"""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)
|
assert caplog.records[1].msg == 'Process {}:\ntest'.format(stream)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.not_frozen
|
|
||||||
@pytest.mark.parametrize('stream', ['stdout', 'stderr'])
|
@pytest.mark.parametrize('stream', ['stdout', 'stderr'])
|
||||||
def test_exit_successful_output(qtbot, proc, py_proc, stream):
|
def test_exit_successful_output(qtbot, proc, py_proc, stream):
|
||||||
"""When a process suceeds, no output should be logged.
|
"""When a process suceeds, no output should be logged.
|
||||||
|
@ -693,7 +693,6 @@ class TestSendOrListen:
|
|||||||
assert "Connecting to {}".format(legacy_server._socketname) in msgs
|
assert "Connecting to {}".format(legacy_server._socketname) in msgs
|
||||||
|
|
||||||
@pytest.mark.posix(reason="Unneeded on Windows")
|
@pytest.mark.posix(reason="Unneeded on Windows")
|
||||||
@pytest.mark.not_frozen
|
|
||||||
def test_stale_legacy_server(self, caplog, qtbot, args, legacy_server,
|
def test_stale_legacy_server(self, caplog, qtbot, args, legacy_server,
|
||||||
ipc_server, py_proc):
|
ipc_server, py_proc):
|
||||||
legacy_name = ipc._get_socketname(args.basedir, legacy=True)
|
legacy_name = ipc._get_socketname(args.basedir, legacy=True)
|
||||||
|
@ -760,7 +760,6 @@ class TestPyQIODevice:
|
|||||||
with pytest.raises(io.UnsupportedOperation):
|
with pytest.raises(io.UnsupportedOperation):
|
||||||
pyqiodev.seek(0, whence)
|
pyqiodev.seek(0, whence)
|
||||||
|
|
||||||
@pytest.mark.not_frozen
|
|
||||||
def test_qprocess(self, py_proc):
|
def test_qprocess(self, py_proc):
|
||||||
"""Test PyQIODevice with a QProcess which is non-sequential.
|
"""Test PyQIODevice with a QProcess which is non-sequential.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user