From 5a1dce426f7a21e3284709fdb971de316069d040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Mon, 31 Mar 2025 13:21:40 +0300 Subject: [PATCH] Remove unnecessary CovFailUnderWarning. Closes #675. --- src/pytest_cov/__init__.py | 6 ------ src/pytest_cov/plugin.py | 2 -- 2 files changed, 8 deletions(-) diff --git a/src/pytest_cov/__init__.py b/src/pytest_cov/__init__.py index 4caae9dc..ef5bf7a5 100644 --- a/src/pytest_cov/__init__.py +++ b/src/pytest_cov/__init__.py @@ -27,12 +27,6 @@ class CovReportWarning(PytestCovWarning): """ -class CovFailUnderWarning(PytestCovWarning): - """ - Indicates that we failed to generate a report. - """ - - class CentralCovContextWarning(PytestCovWarning): """ Indicates that dynamic_context was set to test_function instead of using the builtin --cov-context. diff --git a/src/pytest_cov/plugin.py b/src/pytest_cov/plugin.py index f28907b6..376d876c 100644 --- a/src/pytest_cov/plugin.py +++ b/src/pytest_cov/plugin.py @@ -12,7 +12,6 @@ from coverage.results import should_fail_under from . import CovDisabledWarning -from . import CovFailUnderWarning from . import CovReportWarning from . import compat from . import embed @@ -352,7 +351,6 @@ def pytest_runtestloop(self, session): p=cov_precision, ) session.config.pluginmanager.getplugin('terminalreporter').write(f'\nERROR: {message}\n', red=True, bold=True) - warnings.warn(CovFailUnderWarning(message), stacklevel=1) # make sure we get the EXIT_TESTSFAILED exit code compat_session.testsfailed += 1