Skip to content

fail_under setting with precision is not working #403

Closed
@jonahkagan

Description

@jonahkagan

Summary

I have report: precision set to 2 and fail_under set to 97.47, and my test coverage total is reading as 97.47, but I'm getting a failure message and failure code (exit code 2).

Expected vs actual result

Expected: test coverage passes
Actual: FAIL Required test coverage of 97.47% not reached. Total coverage: 97.47%

I even tried modifying fail_under to 97.469, in which case I got this even more nonsensical message:

FAIL Required test coverage of 97.469% not reached. Total coverage: 97.47%

Reproducer

Versions

Output of relevant packages pip list, python --version, pytest --version etc.

Make sure you include complete output of tox if you use it (it will show versions of various things).

Python 3.7.5
pipenv, version 2018.11.26
pytest version 5.4.1
pytest-cov 2.8.1

Config

Include your tox.ini, pytest.ini, .coveragerc, setup.cfg or any relevant configuration.

# .coveragerc
[report]
fail_under = 97.47
precision = 2
skip_covered = true
show_missing = true

Code

Link to your repository, gist, pastebin or just paste raw code that illustrates the issue.

If you paste raw code make sure you quote it, eg:

votingworks/arlo@89c50e4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions