Skip to content

Commit

Permalink
make @pytest.mark.parametrize annotations one line
Browse files Browse the repository at this point in the history
  • Loading branch information
Yay295 committed Aug 22, 2022
1 parent 1421f94 commit b236c61
Showing 1 changed file with 11 additions and 88 deletions.
99 changes: 11 additions & 88 deletions Tests/test_image_paste.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,7 @@ def gradient_RGBa(self):
],
)

@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
@pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"])
def test_image_solid(self, mode):
im = Image.new(mode, (200, 200), "red")
im2 = getattr(self, "gradient_" + mode)
Expand All @@ -120,14 +113,7 @@ def test_image_solid(self, mode):
im = im.crop((12, 23, im2.width + 12, im2.height + 23))
assert_image_equal(im, im2)

@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
@pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"])
def test_image_mask_1(self, mode):
im = Image.new(mode, (200, 200), "white")
im2 = getattr(self, "gradient_" + mode)
Expand All @@ -149,14 +135,7 @@ def test_image_mask_1(self, mode):
],
)

@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
@pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"])
def test_image_mask_L(self, mode):
im = Image.new(mode, (200, 200), "white")
im2 = getattr(self, "gradient_" + mode)
Expand All @@ -178,14 +157,7 @@ def test_image_mask_L(self, mode):
],
)

@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
@pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"])
def test_image_mask_LA(self, mode):
im = Image.new(mode, (200, 200), "white")
im2 = getattr(self, "gradient_" + mode)
Expand All @@ -207,14 +179,7 @@ def test_image_mask_LA(self, mode):
],
)

@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
@pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"])
def test_image_mask_RGBA(self, mode):
im = Image.new(mode, (200, 200), "white")
im2 = getattr(self, "gradient_" + mode)
Expand All @@ -236,14 +201,7 @@ def test_image_mask_RGBA(self, mode):
],
)

@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
@pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"])
def test_image_mask_RGBa(self, mode):
im = Image.new(mode, (200, 200), "white")
im2 = getattr(self, "gradient_" + mode)
Expand All @@ -265,14 +223,7 @@ def test_image_mask_RGBa(self, mode):
],
)

@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
@pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"])
def test_color_solid(self, mode):
im = Image.new(mode, (200, 200), "black")

Expand All @@ -285,14 +236,7 @@ def test_color_solid(self, mode):
assert head[255] == 128 * 128
assert sum(head[:255]) == 0

@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
@pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"])
def test_color_mask_1(self, mode):
im = Image.new(mode, (200, 200), (50, 60, 70, 80)[: len(mode)])
color = (10, 20, 30, 40)[: len(mode)]
Expand All @@ -314,14 +258,7 @@ def test_color_mask_1(self, mode):
],
)

@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
@pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"])
def test_color_mask_L(self, mode):
im = getattr(self, "gradient_" + mode).copy()
color = "white"
Expand All @@ -343,14 +280,7 @@ def test_color_mask_L(self, mode):
],
)

@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
@pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"])
def test_color_mask_RGBA(self, mode):
im = getattr(self, "gradient_" + mode).copy()
color = "white"
Expand All @@ -372,14 +302,7 @@ def test_color_mask_RGBA(self, mode):
],
)

@pytest.mark.parametrize(
"mode",
[
"RGBA",
"RGB",
"L",
],
)
@pytest.mark.parametrize("mode", ["RGBA", "RGB", "L"])
def test_color_mask_RGBa(self, mode):
im = getattr(self, "gradient_" + mode).copy()
color = "white"
Expand Down

0 comments on commit b236c61

Please sign in to comment.