From 4201a61db7a27b0ac53a0cda713a78cef4fda84a Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Tue, 12 Mar 2024 18:50:00 +0100 Subject: [PATCH 1/2] TST: mark some tests that iterate over all wavelets as slow --- pywt/tests/test_mra.py | 1 + pywt/tests/test_perfect_reconstruction.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pywt/tests/test_mra.py b/pywt/tests/test_mra.py index 76f330591..3bb340e47 100644 --- a/pywt/tests/test_mra.py +++ b/pywt/tests/test_mra.py @@ -174,6 +174,7 @@ def test_mra2_axes(transform, axes, ndim, dtype): # nd mra tests #### +@pytest.mark.slow @pytest.mark.parametrize('wavelet', ['sym2', ]) @pytest.mark.parametrize('transform', ['dwtn', 'swtn']) @pytest.mark.parametrize('mode', pywt.Modes.modes) diff --git a/pywt/tests/test_perfect_reconstruction.py b/pywt/tests/test_perfect_reconstruction.py index 102989213..b5e6f9375 100644 --- a/pywt/tests/test_perfect_reconstruction.py +++ b/pywt/tests/test_perfect_reconstruction.py @@ -6,11 +6,13 @@ import numpy as np +import pytest from numpy.testing import assert_ import pywt +@pytest.mark.slow def test_perfect_reconstruction(): families = ('db', 'sym', 'coif', 'bior', 'rbio') wavelets = sum([pywt.wavelist(name) for name in families], []) From f5c6503682296b73520ae7bbdc8ac9ab1fe4ea78 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Tue, 12 Mar 2024 18:54:29 +0100 Subject: [PATCH 2/2] CI: avoid running slow tests in wheel builds and Emscripten These are extra tests that iterate over all wavelets and require a lot of time even on a regular x86-64 build (~10s for `test_precision`, 42s for `test_swt_iswt` on my machine). For Emscripten and especially under Qemu (Linux aarch64 wheel builds) they're really really slow. These tests aren't essential to run for wheel builds, so disable them. --- .github/workflows/emscripten.yml | 2 +- .github/workflows/wheel_tests_and_release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml index 73def866c..b4d7f5386 100644 --- a/.github/workflows/emscripten.yml +++ b/.github/workflows/emscripten.yml @@ -70,7 +70,7 @@ jobs: pushd demo pip install matplotlib pytest python -c "import pywt; print(pywt.__version__)" - pytest --pyargs pywt + pytest --pyargs pywt -m "not slow" # https://anaconda.org/scientific-python-nightly-wheels/pywavelets # WARNING: this job will overwrite existing wheels. diff --git a/.github/workflows/wheel_tests_and_release.yml b/.github/workflows/wheel_tests_and_release.yml index f3a1e5a14..30a1920d1 100644 --- a/.github/workflows/wheel_tests_and_release.yml +++ b/.github/workflows/wheel_tests_and_release.yml @@ -8,7 +8,7 @@ env: CIBW_BUILD_VERBOSITY: 2 # CIBW_BEFORE_BUILD: pip install cython CIBW_TEST_REQUIRES: pytest - CIBW_TEST_COMMAND: pytest --pyargs pywt + CIBW_TEST_COMMAND: pytest --pyargs pywt -m "not slow" CIBW_ENVIRONMENT: PIP_PREFER_BINARY=1 jobs: