Skip to content

Commit

Permalink
test mutating config
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert authored and ionelmc committed Sep 20, 2019
1 parent 0bd9387 commit 9ce25d5
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tests/test_pytest_cov.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def test_annotate_output_dir(testdir):
assert result.ret == 0


def test_html_output_dir(testdir, prop):
def test_html_output_dir(testdir):
script = testdir.makepyfile(SCRIPT)

result = testdir.runpytest('-v',
Expand All @@ -267,6 +267,27 @@ def test_html_output_dir(testdir, prop):
assert result.ret == 0


def test_term_report_does_not_interact_with_html_output(testdir):
script = testdir.makepyfile(test_funcarg=SCRIPT_FUNCARG)

result = testdir.runpytest('-v',
'--cov=%s' % script.dirpath(),
'--cov-report=term-missing:skip-covered',
'--cov-report=html:' + DEST_DIR,
script)

result.stdout.fnmatch_lines([
'*- coverage: platform *, python * -*',
'Coverage HTML written to dir ' + DEST_DIR,
'*1 passed*',
])
dest_dir = testdir.tmpdir.join(DEST_DIR)
assert dest_dir.check(dir=True)
assert sorted(dest_dir.visit("**/*.html")) == [dest_dir.join("index.html"), dest_dir.join("test_funcarg_py.html")]
assert dest_dir.join("index.html").check()
assert result.ret == 0


def test_xml_output_dir(testdir):
script = testdir.makepyfile(SCRIPT)

Expand Down

0 comments on commit 9ce25d5

Please sign in to comment.