diff options
| -rw-r--r-- | numpy/_pytesttester.py | 18 | ||||
| -rw-r--r-- | numpy/array_api/__init__.py | 5 |
2 files changed, 6 insertions, 17 deletions
diff --git a/numpy/_pytesttester.py b/numpy/_pytesttester.py index 1e24f75a7..bfcbd4f1f 100644 --- a/numpy/_pytesttester.py +++ b/numpy/_pytesttester.py @@ -144,18 +144,12 @@ class PytestTester: # so fetch module for suppression here. from numpy.distutils import cpuinfo - if sys.version_info >= (3, 8): - # 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. - warnings.simplefilter("ignore") - import numpy.array_api - else: - # The array_api submodule is Python 3.8+ only due to the use - # of positional-only argument syntax. We have to ignore it - # completely or the tests will fail at the collection stage. - pytest_args += ['--ignore-glob=numpy/array_api/*'] + # 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. + warnings.simplefilter("ignore") + import numpy.array_api # Filter out annoying import messages. Want these in both develop and # release mode. diff --git a/numpy/array_api/__init__.py b/numpy/array_api/__init__.py index 53c1f3850..1e1ff242f 100644 --- a/numpy/array_api/__init__.py +++ b/numpy/array_api/__init__.py @@ -120,11 +120,6 @@ Still TODO in this module are: import sys -# numpy.array_api is 3.8+ because it makes extensive use of positional-only -# arguments. -if sys.version_info < (3, 8): - raise ImportError("The numpy.array_api submodule requires Python 3.8 or greater.") - import warnings warnings.warn( |
