Skip to content

Commit b3e4ca3

Browse files
committed
add flaky to tests that sometimes fail
1 parent 698c38a commit b3e4ca3

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

adaptive/tests/test_learners.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import shutil
1010
import tempfile
1111

12+
import flaky
1213
import numpy as np
1314
import pytest
1415
import scipy.spatial
@@ -456,6 +457,7 @@ def test_learner_performance_is_invariant_under_scaling(
456457
assert math.isclose(learner.loss(), control.loss(), rel_tol=1e-10)
457458

458459

460+
@flaky.flaky(max_runs=3)
459461
@run_with(
460462
Learner1D,
461463
Learner2D,

adaptive/tests/test_runner.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44
import time
55

6+
import flaky
67
import pytest
78

89
from adaptive.learner import Learner1D, Learner2D
@@ -125,6 +126,7 @@ def test_ipyparallel_executor(ipyparallel_executor):
125126
assert learner.npoints > 0
126127

127128

129+
@flaky.flaky(max_runs=3)
128130
@pytest.mark.timeout(60)
129131
@pytest.mark.skipif(not with_distributed, reason="dask.distributed is not installed")
130132
@pytest.mark.skipif(sys.version_info[:2] == (3, 8), reason="XXX: seems to always fail")

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def get_version_and_cmdclass(package_name):
4343
"plotly",
4444
],
4545
"testing": [
46+
"flaky",
4647
"pytest",
4748
"pytest-cov",
4849
"pytest-randomly",

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ include_trailing_comma=True
6565
force_grid_wrap=0
6666
use_parentheses=True
6767
line_length=88
68-
known_third_party=PIL,atomicwrites,holoviews,matplotlib,nbconvert,numpy,pytest,scipy,setuptools,skopt,sortedcollections,sortedcontainers
68+
known_third_party=PIL,atomicwrites,flaky,holoviews,matplotlib,nbconvert,numpy,pytest,scipy,setuptools,skopt,sortedcollections,sortedcontainers

0 commit comments

Comments
 (0)