Commit 3418eb9 1 parent 8c5a5ff commit 3418eb9 Copy full SHA for 3418eb9
File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,11 @@ markers = [
120
120
# How come these warnings are suppressed successfully here, but not in conftest.py??
121
121
filterwarnings = [
122
122
# 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.
124
128
125
129
# # Pytest warns if it can't collect things that seem to be tests. This should be an error.
126
130
" error::pytest.PytestCollectionWarning" ,
Original file line number Diff line number Diff line change 19
19
20
20
import pytest
21
21
22
- from coverage import env
23
22
from coverage .files import set_relative_directory
24
23
25
24
# Pytest will rewrite assertions in test modules, but not elsewhere.
@@ -45,9 +44,9 @@ def set_warnings() -> None:
45
44
# Warnings to suppress:
46
45
# How come these warnings are successfully suppressed here, but not in pyproject.toml??
47
46
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.
51
50
52
51
# Don't warn about unclosed SQLite connections.
53
52
# We don't close ":memory:" databases because we don't have a way to connect
You can’t perform that action at this time.
0 commit comments