Skip to content

Commit b9f7ea1

Browse files
committed
Test for --cov-append with sub/parallel processes
1 parent 119d746 commit b9f7ea1

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/test_pytest_cov.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,29 @@ def test_do_not_append_coverage(testdir, opts, prop):
18691869
])
18701870

18711871

1872+
@pytest.mark.skipif('sys.platform == "win32" and platform.python_implementation() == "PyPy"')
1873+
def test_append_coverage_subprocess(testdir):
1874+
scripts = testdir.makepyfile(parent_script=SCRIPT_PARENT,
1875+
child_script=SCRIPT_CHILD)
1876+
parent_script = scripts.dirpath().join('parent_script.py')
1877+
1878+
result = testdir.runpytest('-v',
1879+
'--cov=%s' % scripts.dirpath(),
1880+
'--cov-append',
1881+
'--cov-report=term-missing',
1882+
'--dist=load',
1883+
'--tx=2*popen',
1884+
max_worker_restart_0,
1885+
parent_script)
1886+
1887+
result.stdout.fnmatch_lines([
1888+
'*- coverage: platform *, python * -*',
1889+
'child_script* %s*' % CHILD_SCRIPT_RESULT,
1890+
'parent_script* %s*' % PARENT_SCRIPT_RESULT,
1891+
])
1892+
assert result.ret == 0
1893+
1894+
18721895
def test_pth_failure(monkeypatch):
18731896
with open('src/pytest-cov.pth') as fh:
18741897
payload = fh.read()

0 commit comments

Comments
 (0)