Skip to content

Commit 3418eb9

Browse files
committed
clean up the warnings, some we don't need anymore
1 parent 8c5a5ff commit 3418eb9

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

pyproject.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ markers = [
120120
# How come these warnings are suppressed successfully here, but not in conftest.py??
121121
filterwarnings = [
122122
# Sample 'ignore':
123-
#"ignore:the imp module is deprecated in favour of importlib:DeprecationWarning",
123+
# "ignore:the imp module is deprecated in favour of importlib:DeprecationWarning",
124+
125+
# Note: when writing the regex for the message, it's matched with re.match,
126+
# so it has to match the beginning of the message. Add ".*" to make it
127+
# match something in the middle of the message.
124128

125129
## Pytest warns if it can't collect things that seem to be tests. This should be an error.
126130
"error::pytest.PytestCollectionWarning",

tests/conftest.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import pytest
2121

22-
from coverage import env
2322
from coverage.files import set_relative_directory
2423

2524
# Pytest will rewrite assertions in test modules, but not elsewhere.
@@ -45,9 +44,9 @@ def set_warnings() -> None:
4544
# Warnings to suppress:
4645
# How come these warnings are successfully suppressed here, but not in pyproject.toml??
4746

48-
if env.PYPY:
49-
# pypy3 warns about unclosed files a lot.
50-
warnings.filterwarnings("ignore", r".*unclosed file", category=ResourceWarning)
47+
# Note: when writing the regex for the message, it's matched with re.match,
48+
# so it has to match the beginning of the message. Add ".*" to make it
49+
# match something in the middle of the message.
5150

5251
# Don't warn about unclosed SQLite connections.
5352
# We don't close ":memory:" databases because we don't have a way to connect

0 commit comments

Comments
 (0)