Skip to content

Commit

Permalink
add flaky to tests that sometimes fail
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Dec 17, 2019
1 parent 698c38a commit deb90b9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions adaptive/tests/test_learners.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import shutil
import tempfile

import flaky
import numpy as np
import pytest
import scipy.spatial
Expand Down Expand Up @@ -456,6 +457,7 @@ def test_learner_performance_is_invariant_under_scaling(
assert math.isclose(learner.loss(), control.loss(), rel_tol=1e-10)


@flaky.flaky
@run_with(
Learner1D,
Learner2D,
Expand Down
2 changes: 2 additions & 0 deletions adaptive/tests/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
import time

import flaky
import pytest

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


@flaky.flaky
@pytest.mark.timeout(60)
@pytest.mark.skipif(not with_distributed, reason="dask.distributed is not installed")
@pytest.mark.skipif(sys.version_info[:2] == (3, 8), reason="XXX: seems to always fail")
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def get_version_and_cmdclass(package_name):
"plotly",
],
"testing": [
"flaky",
"pytest",
"pytest-cov",
"pytest-randomly",
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=88
known_third_party=PIL,atomicwrites,holoviews,matplotlib,nbconvert,numpy,pytest,scipy,setuptools,skopt,sortedcollections,sortedcontainers
known_third_party=PIL,atomicwrites,flaky,holoviews,matplotlib,nbconvert,numpy,pytest,scipy,setuptools,skopt,sortedcollections,sortedcontainers

0 comments on commit deb90b9

Please sign in to comment.