Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace flaky with pytest-rerunfailures #10335

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dvc/testing/benchmarks/cli/commands/test_get.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest


@pytest.mark.flaky(max_runs=3, min_passes=1)
@pytest.mark.flaky(reruns=3)
def test_get(bench_dvc, tmp_dir, scm, dvc, make_dataset, remote):
dataset = make_dataset(
cache=False, files=False, dvcfile=True, commit=True, remote=True
Expand Down
2 changes: 1 addition & 1 deletion dvc/testing/benchmarks/cli/commands/test_import.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest


@pytest.mark.flaky(max_runs=3, min_passes=1)
@pytest.mark.flaky(reruns=3)
def test_import(bench_dvc, tmp_dir, scm, dvc, make_dataset, remote):
dataset = make_dataset(
cache=False, files=False, dvcfile=True, commit=True, remote=True
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ tests = [
"beautifulsoup4>=4.4",
"dvc-ssh",
"filelock",
"flaky",
"pytest>=7,<8.1",
"pytest>=7,<9",
"pytest-rerunfailures",
"pytest-cov>=4.1.0",
"pytest-docker>=1,<4",
"pytest-mock",
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def pytest_runtest_setup(item):
if "CI" in os.environ and item.get_closest_marker("needs_internet") is not None:
# remotes that need internet connection might be flaky,
# so we rerun them in case it fails.
item.add_marker(pytest.mark.flaky(max_runs=5, min_passes=1))
item.add_marker(pytest.mark.flaky(reruns=5))


@pytest.fixture(scope="session")
Expand Down
3 changes: 1 addition & 2 deletions tests/func/test_data_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import shutil

import pytest
from flaky.flaky_decorator import flaky

import dvc_data
from dvc.cli import main
Expand Down Expand Up @@ -207,7 +206,7 @@ def test_verify_hashes(tmp_dir, scm, dvc, mocker, tmp_path_factory, local_remote
assert hash_spy.call_count == 10


@flaky(max_runs=3, min_passes=1)
@pytest.mark.flaky(reruns=3)
@pytest.mark.parametrize("erepo_type", ["git_dir", "erepo_dir"])
def test_pull_git_imports(request, tmp_dir, dvc, scm, erepo_type):
erepo = request.getfixturevalue(erepo_type)
Expand Down
Loading