From af397beb6c281eea9e526a4b7c910a7def7bc0ee Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Tue, 30 Jul 2024 15:10:09 -0400 Subject: [PATCH] Update test fixture to avoid deprecation warning in pytest caching for numpy 1.24 arrays --- run_script.sh | 2 +- tests/test_units.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/run_script.sh b/run_script.sh index af09db3..19e627a 100755 --- a/run_script.sh +++ b/run_script.sh @@ -31,5 +31,5 @@ if [ -n "$WITH_ASAN" ]; then export DYLD_INSERT_LIBRARIES=$(clang -print-file-name=libclang_rt.asan_osx_dynamic.dylib) fi -python -m pytest -svx tests/ --doctest-glob="docs/*.rst" --doctest-modules docs +python -m pytest -sv tests/ --doctest-glob="docs/*.rst" --doctest-modules docs # make -C docs doctest -e PYTHON=$(python -c "import sys; import pathlib; print(pathlib.Path(sys.executable).resolve(strict=True))") -e DYLD_INSERT_LIBRARIES=$(clang -print-file-name=libclang_rt.asan_osx_dynamic.dylib) diff --git a/tests/test_units.py b/tests/test_units.py index 4326d31..13e4b1a 100644 --- a/tests/test_units.py +++ b/tests/test_units.py @@ -394,8 +394,8 @@ def cls(self): 'g'), 'units_equiv': 'kilogram', 'units_incompat': '°F'}), - ({'args': (np.arange(4, dtype=np.int8), 'g'), - 'args_compat': (0.001 * np.arange(4, dtype=np.int8), 'kg'), + ({'args': (np.arange(3, dtype=np.int8), 'g'), + 'args_compat': (0.001 * np.arange(3, dtype=np.int8), 'kg'), 'units_equiv': 'grams', 'units_incompat': 'seconds'}), ({'args': (np.int32(3), 'degC'),