]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
test_config: Reduce the number of tests 3429/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 25 Jan 2025 17:49:20 +0000 (18:49 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 25 Jan 2025 17:49:20 +0000 (18:49 +0100)
Let's not run unnecessary tests that don't give any meaningful extra
coverage.

tests/test_config.py

index c47918826dcc4a9ad8d587149757390d164d07aa..8aa92d0993bed07fbb71075d58b7a31a4ba240c9 100644 (file)
@@ -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: