Skip to content

Commit

Permalink
tests: remove pytest-lazy-fixture (iterative#10294)
Browse files Browse the repository at this point in the history
Since it's no longer being maintained. See TvoroG/pytest-lazy-fixture#65.
  • Loading branch information
skshetry authored Feb 8, 2024
1 parent c31a5d9 commit b243cca
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ tests = [
"pytest<8,>=7",
"pytest-cov>=4.1.0",
"pytest-docker>=1,<4",
"pytest-lazy-fixture",
"pytest-mock",
"pytest-test-utils",
"pytest-timeout>=2",
Expand Down
7 changes: 3 additions & 4 deletions tests/func/test_data_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,9 @@ def test_verify_hashes(tmp_dir, scm, dvc, mocker, tmp_path_factory, local_remote


@flaky(max_runs=3, min_passes=1)
@pytest.mark.parametrize(
"erepo", [pytest.lazy_fixture("git_dir"), pytest.lazy_fixture("erepo_dir")]
)
def test_pull_git_imports(tmp_dir, dvc, scm, erepo):
@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)
with erepo.chdir():
erepo.scm_gen({"dir": {"bar": "bar"}}, commit="second")
erepo.scm_gen("foo", "foo", commit="first")
Expand Down
14 changes: 6 additions & 8 deletions tests/func/test_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,25 @@ def test_get_repo_broken_dir(tmp_dir, erepo_dir):
assert not (tmp_dir / "out").exists()


@pytest.mark.parametrize(
"erepo", [pytest.lazy_fixture("git_dir"), pytest.lazy_fixture("erepo_dir")]
)
def test_get_git_file(tmp_dir, erepo):
@pytest.mark.parametrize("erepo_type", ["git_dir", "erepo_dir"])
def test_get_git_file(request, tmp_dir, erepo_type):
src = "some_file"
dst = "some_file_imported"

erepo = request.getfixturevalue(erepo_type)
erepo.scm_gen({src: "hello"}, commit="add a regular file")

Repo.get(os.fspath(erepo), src, dst)

assert (tmp_dir / dst).read_text() == "hello"


@pytest.mark.parametrize(
"erepo", [pytest.lazy_fixture("git_dir"), pytest.lazy_fixture("erepo_dir")]
)
def test_get_git_dir(tmp_dir, erepo):
@pytest.mark.parametrize("erepo_type", ["git_dir", "erepo_dir"])
def test_get_git_dir(request, tmp_dir, erepo_type):
src = "some_directory"
dst = "some_directory_imported"

erepo = request.getfixturevalue(erepo_type)
erepo.scm_gen({src: {"dir": {"file.txt": "hello"}}}, commit="add a regular dir")

Repo.get(os.fspath(erepo), src, dst)
Expand Down
10 changes: 6 additions & 4 deletions tests/func/test_ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,17 +518,19 @@ def _ls(path):


@pytest.mark.parametrize(
"dvc_top_level, erepo",
"dvc_top_level, erepo_type",
[
(True, pytest.lazy_fixture("erepo_dir")),
(False, pytest.lazy_fixture("git_dir")),
(True, "erepo_dir"),
(False, "git_dir"),
],
)
def test_subrepo(dvc_top_level, erepo):
def test_subrepo(request, dvc_top_level, erepo_type):
from tests.func.test_get import make_subrepo

dvc_files = {"foo.txt": "foo.txt", "dvc_dir": {"lorem": "lorem"}}
scm_files = {"bar.txt": "bar.txt", "scm_dir": {"ipsum": "ipsum"}}

erepo = request.getfixturevalue(erepo_type)
subrepo = erepo / "subrepo"
make_subrepo(subrepo, erepo.scm)

Expand Down

0 comments on commit b243cca

Please sign in to comment.