From 2cd701c4c3798cc7e6cdee26cf6b3a34007a60d9 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 6 Jun 2025 14:30:54 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A7=AA=20Hide=20false=20negative=20wa?= =?UTF-8?q?rnings=20by=20`coveragepy`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They are only surfaced under pytest 8.4, with `pytest-cov` and `pytest-xdist` being both active [[1]]. [1]: https://github.com/pytest-dev/pytest-cov/issues/693 --- .coveragerc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 From 40cabeef3198925185530a002dd0c54be6aac2c9 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 6 Jun 2025 14:39:32 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9D=20Add=20a=20change=20note=20fo?= =?UTF-8?q?r=20#732?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/changelog-fragments/732.contrib.rst | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 docs/changelog-fragments/732.contrib.rst 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`