From 75fc83af498aa94aaafc47ba972b0e4cf8c60cf7 Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Tue, 28 Oct 2025 13:04:26 +0000 Subject: [PATCH 1/3] add pytest reruns plugin and minimal settings --- environment.yml | 1 + pyproject.toml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/environment.yml b/environment.yml index c3b5c70d..f8eee1e1 100644 --- a/environment.yml +++ b/environment.yml @@ -12,6 +12,7 @@ dependencies: - netcdf4 # has history of broken packages on PyPI - pytest - pytest-cov + - pytest-rerunfailures # documentation - autodocsumm - sphinx diff --git a/pyproject.toml b/pyproject.toml index ea687c28..6aabae84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,6 +49,7 @@ test = [ "pytest>6.0.0", "pytest-cov>=2.10.1", "pytest-html!=2.1.0", + "pytest-rerunfailures", "pytest-xdist", "dask", "flake8", @@ -97,6 +98,7 @@ addopts = [ "--cov-report=xml:test-reports/coverage.xml", "--cov-report=html:test-reports/coverage_html", "--html=test-reports/report.html", + "--reruns=3", ] [tool.coverage.run] From e82ec3c70d57116782e2c017a893c12a538b5f22 Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 29 Oct 2025 14:17:10 +0000 Subject: [PATCH 2/3] rerun only in test module --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6aabae84..29da3ff6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -98,7 +98,6 @@ addopts = [ "--cov-report=xml:test-reports/coverage.xml", "--cov-report=html:test-reports/coverage_html", "--html=test-reports/report.html", - "--reruns=3", ] [tool.coverage.run] From 07f5f570fe6efaf0d63656667973c4a02e06530e Mon Sep 17 00:00:00 2001 From: Valeriu Predoi Date: Wed, 29 Oct 2025 14:17:29 +0000 Subject: [PATCH 3/3] rerun in test module with filter on exception --- tests/test_filter_pipeline_v2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_filter_pipeline_v2.py b/tests/test_filter_pipeline_v2.py index 7acf56fe..f9f117bb 100644 --- a/tests/test_filter_pipeline_v2.py +++ b/tests/test_filter_pipeline_v2.py @@ -17,7 +17,7 @@ def generate_data(): return np.random.rand(100, 100) -@pytest.mark.flaky +@pytest.mark.flaky(reruns=3, only_rerun="ValueError") @pytest.mark.parametrize("chunk_size", [None, (10, 10), (20, 20)], ids=lambda x: f"chunk_{x}") @pytest.mark.parametrize("compression", [None, 9, "lzf"], ids=lambda x: f"compression_{x}") @pytest.mark.parametrize("shuffle", [True, False], ids=lambda x: f"shuffle_{x}")