diff options
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/core/tests/test_regression.py | 2 | ||||
| -rw-r--r-- | numpy/distutils/misc_util.py | 7 | ||||
| -rw-r--r-- | numpy/testing/tests/test_utils.py | 20 | ||||
| -rw-r--r-- | numpy/tests/test_scripts.py | 4 | ||||
| -rw-r--r-- | numpy/typing/tests/data/pass/array_constructors.py | 5 | ||||
| -rw-r--r-- | numpy/typing/tests/data/pass/scalars.py | 7 |
6 files changed, 17 insertions, 28 deletions
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py index 937dcb93e..98e0df9b8 100644 --- a/numpy/core/tests/test_regression.py +++ b/numpy/core/tests/test_regression.py @@ -2480,8 +2480,6 @@ class TestRegression: assert arr.shape == (1, 0, 0) @pytest.mark.skipif(sys.maxsize < 2 ** 31 + 1, reason='overflows 32-bit python') - @pytest.mark.skipif(sys.platform == 'win32' and sys.version_info[:2] < (3, 8), - reason='overflows on windows, fixed in bpo-16865') def test_to_ctypes(self): #gh-14214 arr = np.zeros((2 ** 31 + 1,), 'b') diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py index 42bf807d1..78665d351 100644 --- a/numpy/distutils/misc_util.py +++ b/numpy/distutils/misc_util.py @@ -2348,11 +2348,7 @@ def generate_config_py(target): extra_dll_dir = os.path.join(os.path.dirname(__file__), '.libs') if sys.platform == 'win32' and os.path.isdir(extra_dll_dir): - if sys.version_info >= (3, 8): - os.add_dll_directory(extra_dll_dir) - else: - os.environ.setdefault('PATH', '') - os.environ['PATH'] += os.pathsep + extra_dll_dir + os.add_dll_directory(extra_dll_dir) """)) @@ -2495,4 +2491,3 @@ def exec_mod_from_location(modname, modfile): foo = importlib.util.module_from_spec(spec) spec.loader.exec_module(foo) return foo - diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py index 2af0467f1..7b326365d 100644 --- a/numpy/testing/tests/test_utils.py +++ b/numpy/testing/tests/test_utils.py @@ -1223,7 +1223,7 @@ class TestStringEqual: lambda: assert_string_equal("aaa", "a+b")) -def assert_warn_len_equal(mod, n_in_context, py37=None): +def assert_warn_len_equal(mod, n_in_context): try: mod_warns = mod.__warningregistry__ except AttributeError: @@ -1245,6 +1245,7 @@ def assert_warn_len_equal(mod, n_in_context, py37=None): assert_equal(num_warns, n_in_context) + def test_warn_len_equal_call_scenarios(): # assert_warn_len_equal is called under # varying circumstances depending on serial @@ -1294,22 +1295,20 @@ def test_clear_and_catch_warnings(): warnings.warn('Some warning') assert_equal(my_mod.__warningregistry__, {}) # Without specified modules, don't clear warnings during context - # Python 3.7 catch_warnings doesn't make an entry for 'ignore'. with clear_and_catch_warnings(): warnings.simplefilter('ignore') warnings.warn('Some warning') - assert_warn_len_equal(my_mod, 1, py37=0) + assert_warn_len_equal(my_mod, 1) # Confirm that specifying module keeps old warning, does not add new with clear_and_catch_warnings(modules=[my_mod]): warnings.simplefilter('ignore') warnings.warn('Another warning') - assert_warn_len_equal(my_mod, 1, py37=0) + assert_warn_len_equal(my_mod, 1) # Another warning, no module spec does add to warnings dict, except on - # Python 3.7 catch_warnings doesn't make an entry for 'ignore'. with clear_and_catch_warnings(): warnings.simplefilter('ignore') warnings.warn('Another warning') - assert_warn_len_equal(my_mod, 2, py37=0) + assert_warn_len_equal(my_mod, 2) def test_suppress_warnings_module(): @@ -1338,7 +1337,7 @@ def test_suppress_warnings_module(): # got filtered) assert_equal(len(sup.log), 1) assert_equal(sup.log[0].message.args[0], "Some warning") - assert_warn_len_equal(my_mod, 0, py37=0) + assert_warn_len_equal(my_mod, 0) sup = suppress_warnings() # Will have to be changed if apply_along_axis is moved: sup.filter(module=my_mod) @@ -1352,11 +1351,11 @@ def test_suppress_warnings_module(): assert_warn_len_equal(my_mod, 0) # Without specified modules, don't clear warnings during context - # Python 3.7 does not add ignored warnings. with suppress_warnings(): warnings.simplefilter('ignore') warnings.warn('Some warning') - assert_warn_len_equal(my_mod, 1, py37=0) + assert_warn_len_equal(my_mod, 1) + def test_suppress_warnings_type(): # Initial state of module, no warnings @@ -1380,11 +1379,10 @@ def test_suppress_warnings_type(): assert_warn_len_equal(my_mod, 0) # Without specified modules, don't clear warnings during context - # Python 3.7 does not add ignored warnings. with suppress_warnings(): warnings.simplefilter('ignore') warnings.warn('Some warning') - assert_warn_len_equal(my_mod, 1, py37=0) + assert_warn_len_equal(my_mod, 1) def test_suppress_warnings_decorate_no_record(): diff --git a/numpy/tests/test_scripts.py b/numpy/tests/test_scripts.py index e67a82947..5aa8191bb 100644 --- a/numpy/tests/test_scripts.py +++ b/numpy/tests/test_scripts.py @@ -24,8 +24,8 @@ def find_f2py_commands(): else: # Three scripts are installed in Unix-like systems: # 'f2py', 'f2py{major}', and 'f2py{major.minor}'. For example, - # if installed with python3.7 the scripts would be named - # 'f2py', 'f2py3', and 'f2py3.7'. + # if installed with python3.9 the scripts would be named + # 'f2py', 'f2py3', and 'f2py3.9'. version = sys.version_info major = str(version.major) minor = str(version.minor) diff --git a/numpy/typing/tests/data/pass/array_constructors.py b/numpy/typing/tests/data/pass/array_constructors.py index 2763d9c92..e035a73c6 100644 --- a/numpy/typing/tests/data/pass/array_constructors.py +++ b/numpy/typing/tests/data/pass/array_constructors.py @@ -23,9 +23,8 @@ B = A.view(SubClass).copy() B_stack = np.array([[1], [1]]).view(SubClass) C = [1] -if sys.version_info >= (3, 8): - np.ndarray(Index()) - np.ndarray([Index()]) +np.ndarray(Index()) +np.ndarray([Index()]) np.array(1, dtype=float) np.array(1, copy=False) diff --git a/numpy/typing/tests/data/pass/scalars.py b/numpy/typing/tests/data/pass/scalars.py index b258db49f..684d41fad 100644 --- a/numpy/typing/tests/data/pass/scalars.py +++ b/numpy/typing/tests/data/pass/scalars.py @@ -59,10 +59,9 @@ np.float64(None) np.float32("1") np.float16(b"2.5") -if sys.version_info >= (3, 8): - np.uint64(D()) - np.float32(D()) - np.complex64(D()) +np.uint64(D()) +np.float32(D()) +np.complex64(D()) np.bytes_(b"hello") np.bytes_("hello", 'utf-8') |
