8000 Use catch_warnings(record=True) instead of simplefilter('ignore') · numpy/numpy@7091e4c · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7091e4c

Browse files
committed
Use catch_warnings(record=True) instead of simplefilter('ignore')
There is a test that fails in the presence of simplefilter('ignore') (test_warnings.py). catch_warnings(record=True) seems to be a way to get the same behavior without failing the test.
1 parent 06ec0ec commit 7091e4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

numpy/_pytesttester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ def __call__(self, label='fast', verbose=1, extra_argv=None,
144144
# so fetch module for suppression here.
145145
from numpy.distutils import cpuinfo
146146

147 6409 +
with warnings.catch_warnings(record=True):
147148
# Ignore the warning from importing the array_api submodule. This
148149
# warning is done on import, so it would break pytest collection,
149150
# but importing it early here prevents the warning from being
150151
# issued when it imported again.
151-
warnings.simplefilter("ignore")
152152
import numpy.array_api
153153

154154
# Filter out annoying import messages. Want these in both develop and

0 commit comments

Comments
 (0)
0