mirror of
https://github.com/ansible/awx.git
synced 2026-01-07 14:02:07 -03:30
They are only surfaced under pytest 8.4, with `pytest-cov` and `pytest-xdist` being both active [[1]]. Or equivalent situations This is a follow-up for #16015 which attempted ignoring the warning on the runtime level in pytest. Instead, the patch tells `coveragepy` not to emit said warnings in the first place. [1]: pytest-dev/pytest-cov#693
48 lines
1.3 KiB
INI
48 lines
1.3 KiB
INI
[report]
|
|
# Regexes for lines to exclude from consideration
|
|
exclude_also =
|
|
# Don't complain about missing debug-only code:
|
|
def __repr__
|
|
if self\.debug
|
|
|
|
# Don't complain if tests don't hit defensive assertion code:
|
|
raise AssertionError
|
|
raise NotImplementedError
|
|
|
|
# Don't complain if non-runnable code isn't run:
|
|
if 0:
|
|
if __name__ == .__main__.:
|
|
|
|
^\s*@pytest\.mark\.xfail
|
|
|
|
[run]
|
|
branch = True
|
|
# NOTE: `disable_warnings` is needed when `pytest-cov` runs in tandem
|
|
# NOTE: with `pytest-xdist`. These warnings are false negative in this
|
|
# NOTE: context.
|
|
#
|
|
# NOTE: It's `coveragepy` that emits the warnings and previously they
|
|
# NOTE: wouldn't get on the radar of `pytest`'s `filterwarnings`
|
|
# NOTE: mechanism. This changed, however, with `pytest >= 8.4`. And
|
|
# NOTE: since we set `filterwarnings = error`, those warnings are being
|
|
# NOTE: raised as exceptions, cascading into `pytest`'s internals and
|
|
# NOTE: causing tracebacks and crashes of the test sessions.
|
|
#
|
|
# Ref:
|
|
# * https://github.com/pytest-dev/pytest-cov/issues/693
|
|
# * https://github.com/pytest-dev/pytest-cov/pull/695
|
|
# * https://github.com/pytest-dev/pytest-cov/pull/696
|
|
disable_warnings =
|
|
module-not-measured
|
|
omit =
|
|
awx/main/migrations/*
|
|
awx/settings/defaults.py
|
|
awx/settings/*_defaults.py
|
|
source =
|
|
.
|
|
source_pkgs =
|
|
awx
|
|
|
|
[xml]
|
|
output = ./reports/coverage.xml
|