diff --git a/.coveragerc b/.coveragerc index 17bef5529..4630786a7 100644 --- a/.coveragerc +++ b/.coveragerc @@ -28,6 +28,23 @@ show_missing = true [run] branch = true cover_pylib = false +# 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 plugins = # covdefaults Cython.Coverage diff --git a/docs/changelog-fragments/732.contrib.rst b/docs/changelog-fragments/732.contrib.rst new file mode 100644 index 000000000..a3d196bef --- /dev/null +++ b/docs/changelog-fragments/732.contrib.rst @@ -0,0 +1,7 @@ +False negative warnings reported by ``coveragepy`` when are now +disabled. They are evident when ``pytest-cov`` runs with the +``pytest-xdist`` integration. ``pytest`` 8.4 gives them more +visibility and out ``filterwarnings = error`` setting was turning +them into errors before this change. + +-- by :user:`webknjaz`