Skip to content

Commit 12a8de7

Browse files
graingertionelmc
authored andcommitted
test cov-fail-under float pass and fail
1 parent 7f2cfad commit 12a8de7

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

tests/test_pytest_cov.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,25 @@ def test_cov_min_float_value(testdir):
349349
result = testdir.runpytest('-v',
350350
'--cov=%s' % script.dirpath(),
351351
'--cov-report=term-missing',
352-
'--cov-fail-under=51.03',
352+
'--cov-fail-under=88.88',
353353
script)
354354
assert result.ret == 0
355355
result.stdout.fnmatch_lines([
356-
'Required test coverage of 51.03% reached. Total coverage: *%'
356+
'Required test coverage of 88.88% reached. Total coverage: 88.89%'
357+
])
358+
359+
360+
def test_cov_min_float_value_not_reached(testdir):
361+
script = testdir.makepyfile(SCRIPT)
362+
363+
result = testdir.runpytest('-v',
364+
'--cov=%s' % script.dirpath(),
365+
'--cov-report=term-missing',
366+
'--cov-fail-under=88.89',
367+
script)
368+
assert result.ret == 1
369+
result.stdout.fnmatch_lines([
370+
'FAIL Required test coverage of 88.89% not reached. Total coverage: 88.89%'
357371
])
358372

359373

0 commit comments

Comments
 (0)