diff --git a/pyproject.toml b/pyproject.toml index 9380bccf..08b2f0d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,6 +58,7 @@ test = [ "pytest-cov", "pytest-doctestplus", "pytest-mock", + "pytest-rerunfailures", "scipy", ] diff --git a/tests/test_shapes.py b/tests/test_shapes.py index f9744a6c..5f3bf3bc 100644 --- a/tests/test_shapes.py +++ b/tests/test_shapes.py @@ -89,6 +89,7 @@ def test_ellipticity_ryden04(rng: np.random.Generator) -> None: assert np.all((e.real >= -1.0) & (e.real <= 1.0)) +@pytest.mark.flaky(rerun=5, only_rerun=["AssertionError"]) def test_ellipticity_gaussian(rng: np.random.Generator) -> None: n = 1_000_000 @@ -105,7 +106,7 @@ def test_ellipticity_gaussian(rng: np.random.Generator) -> None: np.testing.assert_array_less(np.abs(eps), 1) np.testing.assert_allclose(np.std(eps.real), 0.256, atol=1e-3, rtol=0) - np.testing.assert_allclose(np.std(eps.imag), 0.256, atol=1e-2, rtol=0) + np.testing.assert_allclose(np.std(eps.imag), 0.256, atol=1e-3, rtol=0) eps = ellipticity_gaussian([n, n], [0.128, 0.256])