summaryrefslogtreecommitdiff
path: root/coverage/pytracer.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-05-30 17:39:20 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-05-30 18:03:05 -0400
commit30c023b5b74f9c798645cbb3f35362ae046a4c25 (patch)
treee86df1a4c044ec9b2919068297dfd91a382eeb84 /coverage/pytracer.py
parent22fe2eb167a18dda8fd3e14cbf9166a1c7331fb9 (diff)
downloadpython-coveragepy-git-30c023b5b74f9c798645cbb3f35362ae046a4c25.tar.gz
feat: warnings are now real warnings
This makes coverage warnings visible when running test suites under pytest. But it also means some uninteresting warnings would show up in our own test suite, so we had to catch or suppress those.
Diffstat (limited to 'coverage/pytracer.py')
-rw-r--r--coverage/pytracer.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/coverage/pytracer.py b/coverage/pytracer.py
index 51f08a1b..540df68c 100644
--- a/coverage/pytracer.py
+++ b/coverage/pytracer.py
@@ -254,10 +254,8 @@ class PyTracer:
# has changed to None.
dont_warn = (env.PYPY and env.PYPYVERSION >= (5, 4) and self.in_atexit and tf is None)
if (not dont_warn) and tf != self._trace: # pylint: disable=comparison-with-callable
- self.warn(
- f"Trace function changed, measurement is likely wrong: {tf!r}",
- slug="trace-changed",
- )
+ msg = f"Trace function changed, measurement is likely wrong: {tf!r}"
+ self.warn(msg, slug="trace-changed")
def activity(self):
"""Has there been any activity?"""