Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/pytest_cov/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def start(self):

self.cov = coverage.Coverage(source=self.cov_source,
branch=self.cov_branch,
data_suffix=True,
config_file=self.cov_config)
self.combining_cov = coverage.Coverage(source=self.cov_source,
branch=self.cov_branch,
Expand Down
23 changes: 23 additions & 0 deletions tests/test_pytest_cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,29 @@ def test_do_not_append_coverage(testdir, opts, prop):
])


@pytest.mark.skipif('sys.platform == "win32" and platform.python_implementation() == "PyPy"')
def test_append_coverage_subprocess(testdir):
scripts = testdir.makepyfile(parent_script=SCRIPT_PARENT,
child_script=SCRIPT_CHILD)
parent_script = scripts.dirpath().join('parent_script.py')

result = testdir.runpytest('-v',
'--cov=%s' % scripts.dirpath(),
'--cov-append',
'--cov-report=term-missing',
'--dist=load',
'--tx=2*popen',
max_worker_restart_0,
parent_script)

result.stdout.fnmatch_lines([
'*- coverage: platform *, python * -*',
'child_script* %s*' % CHILD_SCRIPT_RESULT,
'parent_script* %s*' % PARENT_SCRIPT_RESULT,
])
assert result.ret == 0


def test_pth_failure(monkeypatch):
with open('src/pytest-cov.pth') as fh:
payload = fh.read()
Expand Down