summaryrefslogtreecommitdiff
path: root/numpy/_pytesttester.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/_pytesttester.py')
-rw-r--r--numpy/_pytesttester.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/numpy/_pytesttester.py b/numpy/_pytesttester.py
index acfaa1ca5..8decb9dd7 100644
--- a/numpy/_pytesttester.py
+++ b/numpy/_pytesttester.py
@@ -137,13 +137,20 @@ class PytestTester:
# offset verbosity. The "-q" cancels a "-v".
pytest_args += ["-q"]
- # Filter out distutils cpu warnings (could be localized to
- # distutils tests). ASV has problems with top level import,
- # so fetch module for suppression here.
with warnings.catch_warnings():
warnings.simplefilter("always")
+ # Filter out distutils cpu warnings (could be localized to
+ # distutils tests). ASV has problems with top level import,
+ # so fetch module for suppression here.
from numpy.distutils import cpuinfo
+ with warnings.catch_warnings(record=True):
+ # Ignore the warning from importing the array_api submodule. This
+ # warning is done on import, so it would break pytest collection,
+ # but importing it early here prevents the warning from being
+ # issued when it imported again.
+ import numpy.array_api
+
# Filter out annoying import messages. Want these in both develop and
# release mode.
pytest_args += [