From: Daan De Meyer Date: Sat, 25 Jan 2025 17:49:20 +0000 (+0100) Subject: test_config: Reduce the number of tests X-Git-Tag: v25.3~16^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3429%2Fhead;p=thirdparty%2Fmkosi.git test_config: Reduce the number of tests Let's not run unnecessary tests that don't give any meaningful extra coverage. --- diff --git a/tests/test_config.py b/tests/test_config.py index c47918826..8aa92d099 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -717,7 +717,10 @@ def test_match_empty(tmp_path: Path) -> None: assert config.environment.get("ABC") is None -@pytest.mark.parametrize("dist1,dist2", itertools.combinations_with_replacement(Distribution, 2)) +@pytest.mark.parametrize( + "dist1,dist2", + itertools.combinations_with_replacement([Distribution.debian, Distribution.opensuse], 2), +) def test_match_distribution(tmp_path: Path, dist1: Distribution, dist2: Distribution) -> None: with chdir(tmp_path): parent = Path("mkosi.conf") @@ -771,7 +774,7 @@ def test_match_distribution(tmp_path: Path, dist1: Distribution, dist2: Distribu assert "testpkg3" in conf.packages -@pytest.mark.parametrize("release1,release2", itertools.combinations_with_replacement([36, 37, 38], 2)) +@pytest.mark.parametrize("release1,release2", itertools.combinations_with_replacement([36, 37], 2)) def test_match_release(tmp_path: Path, release1: int, release2: int) -> None: with chdir(tmp_path): parent = Path("mkosi.conf") @@ -865,9 +868,7 @@ def test_match_repositories(tmp_path: Path) -> None: assert config.output == "qed" -@pytest.mark.parametrize( - "image1,image2", itertools.combinations_with_replacement(["image_a", "image_b", "image_c"], 2) -) +@pytest.mark.parametrize("image1,image2", itertools.combinations_with_replacement(["image_a", "image_b"], 2)) def test_match_imageid(tmp_path: Path, image1: str, image2: str) -> None: with chdir(tmp_path): parent = Path("mkosi.conf") @@ -939,7 +940,7 @@ def test_match_imageid(tmp_path: Path, image1: str, image2: str) -> None: "op,version", itertools.product( ["", "==", "<", ">", "<=", ">="], - [122, 123, 124], + [122, 123], ), ) def test_match_imageversion(tmp_path: Path, op: str, version: str) -> None: