refactor so we only check coverage in one place

This commit is contained in:
meejah
2019-08-07 14:03:16 -06:00
parent 8cde74b49a
commit 025b89855f
2 changed files with 24 additions and 25 deletions

View File

@ -31,6 +31,7 @@ from util import (
_create_node,
_run_node,
_cleanup_twistd_process,
_tahoe_runner_optional_coverage,
)
@ -158,24 +159,6 @@ def flog_gatherer(reactor, temp_dir, flog_binary, request):
return furl
def _tahoe_runner_optional_coverage(proto, reactor, request, other_args):
"""
Internal helper. Calls spawnProcess with `-m
allmydata.scripts.runner` and `other_args`, optionally inserting a
`--coverage` option if the `request` indicates we should.
"""
if request.config.getoption('coverage'):
args = [sys.executable, '-m', 'coverage', 'run', '-m', 'allmydata.scripts.runner', '--coverage']
else:
args = [sys.executable, '-m', 'allmydata.scripts.runner']
args += other_args
return reactor.spawnProcess(
proto,
sys.executable,
args,
)
@pytest.fixture(scope='session')
@log_call(
action_type=u"integration:introducer",