Skip to content

Commit 3b2e031

Browse files
authored
replace flaky with pytest-rerunfailures (#10335)
* Revert "limit pytest version to <8.1 (#10334)" This reverts commit bc95b65. * replace flaky with pytest-rerunfailures `flaky` project seems to be unmaintained (see box/flaky#192). `pytest-rerunfailures` seems to be maintained under `pytest-dev` and tests 5 minor releases of pytest. Note that this plugin is not compatible with `flaky` plugin. You will have to uninstall it if it exists.
1 parent e5ee82b commit 3b2e031

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

dvc/testing/benchmarks/cli/commands/test_get.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pytest
22

33

4-
@pytest.mark.flaky(max_runs=3, min_passes=1)
4+
@pytest.mark.flaky(reruns=3)
55
def test_get(bench_dvc, tmp_dir, scm, dvc, make_dataset, remote):
66
dataset = make_dataset(
77
cache=False, files=False, dvcfile=True, commit=True, remote=True

dvc/testing/benchmarks/cli/commands/test_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pytest
22

33

4-
@pytest.mark.flaky(max_runs=3, min_passes=1)
4+
@pytest.mark.flaky(reruns=3)
55
def test_import(bench_dvc, tmp_dir, scm, dvc, make_dataset, remote):
66
dataset = make_dataset(
77
cache=False, files=False, dvcfile=True, commit=True, remote=True

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ tests = [
102102
"beautifulsoup4>=4.4",
103103
"dvc-ssh",
104104
"filelock",
105-
"flaky",
106-
"pytest>=7,<8.1",
105+
"pytest>=7,<9",
106+
"pytest-rerunfailures",
107107
"pytest-cov>=4.1.0",
108108
"pytest-docker>=1,<4",
109109
"pytest-mock",

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def pytest_runtest_setup(item):
123123
if "CI" in os.environ and item.get_closest_marker("needs_internet") is not None:
124124
# remotes that need internet connection might be flaky,
125125
# so we rerun them in case it fails.
126-
item.add_marker(pytest.mark.flaky(max_runs=5, min_passes=1))
126+
item.add_marker(pytest.mark.flaky(reruns=5))
127127

128128

129129
@pytest.fixture(scope="session")

tests/func/test_data_cloud.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import shutil
44

55
import pytest
6-
from flaky.flaky_decorator import flaky
76

87
import dvc_data
98
from dvc.cli import main
@@ -207,7 +206,7 @@ def test_verify_hashes(tmp_dir, scm, dvc, mocker, tmp_path_factory, local_remote
207206
assert hash_spy.call_count == 10
208207

209208

210-
@flaky(max_runs=3, min_passes=1)
209+
@pytest.mark.flaky(reruns=3)
211210
@pytest.mark.parametrize("erepo_type", ["git_dir", "erepo_dir"])
212211
def test_pull_git_imports(request, tmp_dir, dvc, scm, erepo_type):
213212
erepo = request.getfixturevalue(erepo_type)

0 commit comments

Comments
 (0)