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:
Florian Bruhin 2016-01-20 18:19:29 +01:00
parent 039ae74662
commit 03118bd804
2 changed files with 12 additions and 1 deletions

View File

@ -22,5 +22,5 @@
"""Things needed for integration testing."""
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

View File

@ -393,3 +393,14 @@ def quteproc(quteproc_process, httpbin, request):
quteproc_process.before_test()
yield quteproc_process
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()