tests: Add a quteproc_new fixture.
This can be used to spawn a dedicated qutebrowser subprocess for a given test, e.g. to test specific commandline arguments.
This commit is contained in:
parent
039ae74662
commit
03118bd804
@ -22,5 +22,5 @@
|
|||||||
"""Things needed for integration testing."""
|
"""Things needed for integration testing."""
|
||||||
|
|
||||||
from webserver import httpbin, httpbin_after_test, ssl_server
|
from webserver import httpbin, httpbin_after_test, ssl_server
|
||||||
from quteprocess import quteproc_process, quteproc
|
from quteprocess import quteproc_process, quteproc, quteproc_new
|
||||||
from testprocess import pytest_runtest_makereport
|
from testprocess import pytest_runtest_makereport
|
||||||
|
@ -393,3 +393,14 @@ def quteproc(quteproc_process, httpbin, request):
|
|||||||
quteproc_process.before_test()
|
quteproc_process.before_test()
|
||||||
yield quteproc_process
|
yield quteproc_process
|
||||||
quteproc_process.after_test()
|
quteproc_process.after_test()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.yield_fixture
|
||||||
|
def quteproc_new(qapp, httpbin, request):
|
||||||
|
"""Per-test qutebrowser process to test invocations."""
|
||||||
|
delay = request.config.getoption('--qute-delay')
|
||||||
|
proc = QuteProc(httpbin, delay)
|
||||||
|
request.node._quteproc_log = proc.captured_log
|
||||||
|
# Not calling before_test here as that would start the process
|
||||||
|
yield proc
|
||||||
|
proc.after_test()
|
||||||
|
Loading…
Reference in New Issue
Block a user