Improve test_smoke
There's currently an error on exit which doesn't get caught with --nowindow and not with ":later 500 quit". We also need to check the output as there's an additional segfault when that happens...
This commit is contained in:
parent
7f9af096cd
commit
214641301c
@ -26,18 +26,20 @@ import signal
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('cmd', [':quit', ':later 500 quit'])
|
||||||
def test_smoke():
|
def test_smoke(cmd, capfd):
|
||||||
if hasattr(sys, 'frozen'):
|
if hasattr(sys, 'frozen'):
|
||||||
argv = [os.path.join(os.path.dirname(sys.executable), 'qutebrowser')]
|
argv = [os.path.join(os.path.dirname(sys.executable), 'qutebrowser')]
|
||||||
else:
|
else:
|
||||||
argv = [sys.executable, '-m', 'qutebrowser']
|
argv = [sys.executable, '-m', 'qutebrowser']
|
||||||
argv += ['--debug', '--no-err-windows', '--nowindow', '--temp-basedir',
|
argv += ['--debug', '--no-err-windows', '--temp-basedir', 'about:blank',
|
||||||
'about:blank', ':later 500 quit']
|
cmd]
|
||||||
try:
|
try:
|
||||||
subprocess.check_call(argv)
|
subprocess.check_call(argv)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
if e.returncode == -signal.SIGSEGV:
|
if e.returncode == -signal.SIGSEGV:
|
||||||
|
_out, err = capfd.readouterr()
|
||||||
|
assert 'Uncaught exception' not in err
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
# https://github.com/The-Compiler/qutebrowser/issues/1387
|
# https://github.com/The-Compiler/qutebrowser/issues/1387
|
||||||
pytest.xfail("Ignoring segfault on exit...")
|
pytest.xfail("Ignoring segfault on exit...")
|
||||||
|
Loading…
Reference in New Issue
Block a user