summaryrefslogtreecommitdiff
path: root/numpy/_pytesttester.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2021-08-23 21:32:20 -0600
committerGitHub <noreply@github.com>2021-08-23 21:32:20 -0600
commit098f874144161b6a49efa5108846a408ca8f39b8 (patch)
treed618c32a54705d38e5458669774c88d9f6225212 /numpy/_pytesttester.py
parenta3ac75c6f92ed158777492f343dc59adeacb745c (diff)
parent7091e4c48ce7af8a5263b6808a6d7976d4af4c6f (diff)
downloadnumpy-098f874144161b6a49efa5108846a408ca8f39b8.tar.gz
Merge pull request #18585 from data-apis/array-api
ENH: Implementation of the NEP 47 (adopting the array API standard)
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 += [