From 634a83df94f9becbc06665cf52dd335c99af4fd6 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 25 Jun 2024 23:25:04 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A7=AA=20Unmeasure=20xfail=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These tests are known to only be executed partially or not at all. So we always get incomplete, missing, and sometimes flaky, coverage in the test functions that are expected to fail. This change updates the ``coverage.py`` config to prevent said tests from influencing the coverage level measurement. --- .coveragerc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.coveragerc b/.coveragerc index a335557d4..b81047141 100644 --- a/.coveragerc +++ b/.coveragerc @@ -29,3 +29,5 @@ exclude_lines = ^\s*if TYPE_CHECKING: ^\s*@overload( |$) + + ^\s*@pytest\.mark\.xfail From f2acc65485d7b21a42631df507c78d4c7237766d Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 25 Jun 2024 23:33:43 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9D=20Add=20a=20change=20note=20fo?= =?UTF-8?q?r=20PR=20#12531?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog/12531.contrib.rst | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelog/12531.contrib.rst diff --git a/changelog/12531.contrib.rst b/changelog/12531.contrib.rst new file mode 100644 index 000000000..fd83b211f --- /dev/null +++ b/changelog/12531.contrib.rst @@ -0,0 +1,6 @@ +The coverage reporting configuration has been updated to exclude +pytest's own tests marked as expected to fail from the coverage +report. This has an effect of reducing the influence of flaky +tests on the resulting number. + +-- by :user`webknjaz`