Skip to content
Snippets Groups Projects
Verified Commit c37e4f2e authored by David Runge's avatar David Runge :chipmunk:
Browse files

feat: Switch from pytest-lazy-fixture to pytest-lazy-fixtures


The `pytest-lazy-fixture` project is abandonware and
`pytest-lazy-fixtures` seems to be actively developed and to actually
work.

Signed-off-by: default avatarDavid Runge <dvzrv@archlinux.org>
parent 5df965fa
No related branches found
No related tags found
1 merge request!160Adapt to changes in pacman 6.1
......@@ -73,7 +73,6 @@ dev = [
"mypy[install-types,reports]>=1.3",
"pytest>=7.4.0",
"pytest-asyncio>=0.21.0",
"pytest-lazy-fixture>=0.6.3",
"sphinx>=6.0.0",
"sphinx-rtd-theme>=1.2.2",
"sphinx-argparse>=0.4.0",
......@@ -81,6 +80,7 @@ dev = [
"vulture>=2.7",
"pydocstyle>=6.3.0",
"bandit>=1.7.5",
"pytest-lazy-fixtures>=1.0.7",
]
[tool.pdm]
......
......@@ -5,7 +5,7 @@ from unittest.mock import patch
from pydantic import ValidationError
from pytest import mark, raises
from pytest_lazyfixture import lazy_fixture
from pytest_lazy_fixtures import lf
from repod.common import models
from repod.version.alpm import vercmp
......@@ -177,7 +177,7 @@ def test_pkgrel(value: str, expectation: ContextManager[str]) -> None:
("1.1", "1.2", -1),
],
)
@mark.parametrize("pyalpm_vercmp", [lazy_fixture("pyalpm_vercmp_fun")])
@mark.parametrize("pyalpm_vercmp", [lf("pyalpm_vercmp_fun")])
def test_pkgrel_vercmp(subj: str, obj: str, expectation: int, pyalpm_vercmp: bool) -> None:
"""Tests for repod.common.models.PkgRel comparing using vercmp."""
with patch("repod.version.alpm.PYALPM_VERCMP", pyalpm_vercmp):
......@@ -254,7 +254,7 @@ def test_pkgver(value: str, expectation: ContextManager[str]) -> None:
("1.a001a.1", "1.a1a.1", 0),
],
)
@mark.parametrize("pyalpm_vercmp", [lazy_fixture("pyalpm_vercmp_fun")])
@mark.parametrize("pyalpm_vercmp", [lf("pyalpm_vercmp_fun")])
def test_pkgver_vercmp(subj: str, obj: str, expectation: int, pyalpm_vercmp: bool) -> None:
"""Tests for repod.common.models.PkgVer comparing using vercmp."""
with patch("repod.version.alpm.PYALPM_VERCMP", pyalpm_vercmp):
......@@ -339,7 +339,7 @@ def test_version_get_pkgrel(value: str, expectation: models.PkgRel | None) -> No
("1.0.0-1", "1:1.0.0-1", -1),
],
)
@mark.parametrize("pyalpm_vercmp", [lazy_fixture("pyalpm_vercmp_fun")])
@mark.parametrize("pyalpm_vercmp", [lf("pyalpm_vercmp_fun")])
def test_version_vercmp(subj: str, obj: str, expectation: int, pyalpm_vercmp: bool) -> None:
"""Tests for repod.common.models.Version.vercmp."""
with patch("repod.version.alpm.PYALPM_VERCMP", pyalpm_vercmp):
......
......@@ -2,7 +2,7 @@
from unittest.mock import patch
from pytest import mark
from pytest_lazyfixture import lazy_fixture
from pytest_lazy_fixtures import lf
from repod.version.alpm import pkg_vercmp, vercmp
......@@ -58,7 +58,7 @@ from repod.version.alpm import pkg_vercmp, vercmp
("", "a", 1),
],
)
@mark.parametrize("pyalpm_vercmp", [lazy_fixture("pyalpm_vercmp_fun")])
@mark.parametrize("pyalpm_vercmp", [lf("pyalpm_vercmp_fun")])
def test_vercmp(first: str, second: str, expectation: int, pyalpm_vercmp: bool) -> None:
"""Tests for repod.version.alpm.vercmp."""
with patch("repod.version.alpm.PYALPM_VERCMP", pyalpm_vercmp):
......@@ -73,7 +73,7 @@ def test_vercmp(first: str, second: str, expectation: int, pyalpm_vercmp: bool)
("1:2-3", "1:2-4", -1),
],
)
@mark.parametrize("pyalpm_vercmp", [lazy_fixture("pyalpm_vercmp_fun")])
@mark.parametrize("pyalpm_vercmp", [lf("pyalpm_vercmp_fun")])
def test_pkgver_vercmp(first: str, second: str, expectation: int, pyalpm_vercmp: bool) -> None:
"""Tests for repod.version.alpm.pkg_vercmp."""
with patch("repod.version.alpm.PYALPM_VERCMP", pyalpm_vercmp):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment