Skip to content

Commit

Permalink
Test for --cov-append with sub/parallel processes
Browse files Browse the repository at this point in the history
  • Loading branch information
Urth committed Jan 21, 2020
1 parent 119d746 commit 882cdc5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_pytest_cov.py
Expand Up @@ -1869,6 +1869,28 @@ 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

0 comments on commit 882cdc5

Please sign in to comment.