Skip to content

Commit c90ab34

Browse files
committed
Modified the test to display the image.
1 parent c9dc553 commit c90ab34

17 files changed

+94
-0
lines changed

tests/test_alpha.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def test_alpha_by_rgba(setup):
4040
)
4141
alpha = create_alpha_mask(image)
4242
image.putalpha(alpha)
43+
image.show()
4344
assert image.mode == "RGBA"
4445

4546

@@ -49,4 +50,5 @@ def test_alpha_by_grayscale_with_alpha(setup):
4950
)
5051
alpha = create_alpha_mask(image)
5152
image.putalpha(alpha)
53+
image.show()
5254
assert image.mode == "LA"

tests/test_brightness.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def test_brightness_by_rgb(setup):
1010
os.path.join(".", "tests", "pic", "dog.jpg"),
1111
)
1212
image = Processor(image=image, brightness=1.2).process()
13+
image.show()
1314
assert image.mode == "RGB"
1415

1516

@@ -18,6 +19,7 @@ def test_brightness_by_grayscale(setup):
1819
os.path.join(".", "tests", "pic", "tokyo_station.jpg"),
1920
)
2021
image = Processor(image=image, brightness=1.2).process()
22+
image.show()
2123
assert image.mode == "L"
2224

2325

@@ -26,6 +28,7 @@ def test_brightness_by_rgba(setup):
2628
os.path.join(".", "tests", "pic", "nullpo.png"),
2729
)
2830
image = Processor(image=image, brightness=1.2).process()
31+
image.show()
2932
assert image.mode == "RGB"
3033

3134

@@ -34,4 +37,5 @@ def test_brightness_by_grayscale_with_alpha(setup):
3437
os.path.join(".", "tests", "pic", "test.png"),
3538
)
3639
image = Processor(image=image, brightness=1.2).process()
40+
image.show()
3741
assert image.mode == "L"

tests/test_color.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def test_color_by_rgb(setup):
1010
os.path.join(".", "tests", "pic", "dog.jpg"),
1111
)
1212
image = Processor(image=image, color=1.2).process()
13+
image.show()
1314
assert image.mode == "RGB"
1415

1516

@@ -18,6 +19,7 @@ def test_color_by_grayscale(setup):
1819
os.path.join(".", "tests", "pic", "tokyo_station.jpg"),
1920
)
2021
image = Processor(image=image, color=1.2).process()
22+
image.show()
2123
assert image.mode == "L"
2224

2325

@@ -26,6 +28,7 @@ def test_color_by_rgba(setup):
2628
os.path.join(".", "tests", "pic", "nullpo.png"),
2729
)
2830
image = Processor(image=image, color=1.2).process()
31+
image.show()
2932
assert image.mode == "RGB"
3033

3134

@@ -34,4 +37,5 @@ def test_color_by_grayscale_with_alpha(setup):
3437
os.path.join(".", "tests", "pic", "test.png"),
3538
)
3639
image = Processor(image=image, color=1.2).process()
40+
image.show()
3741
assert image.mode == "L"

tests/test_colorautoadjust.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def test_colorautoadjust_by_rgb(setup):
1010
os.path.join(".", "tests", "pic", "dog.jpg"),
1111
)
1212
image = Processor(image=image, colorautoadjust=True).process()
13+
image.show()
1314
assert image.mode == "RGB"
1415

1516

@@ -18,6 +19,7 @@ def test_colorautoadjust_by_grayscale(setup):
1819
os.path.join(".", "tests", "pic", "tokyo_station.jpg"),
1920
)
2021
image = Processor(image=image, colorautoadjust=True).process()
22+
image.show()
2123
assert image.mode == "L"
2224

2325

@@ -26,6 +28,7 @@ def test_colorautoadjust_by_rgba(setup):
2628
os.path.join(".", "tests", "pic", "nullpo.png"),
2729
)
2830
image = Processor(image=image, colorautoadjust=True).process()
31+
image.show()
2932
assert image.mode == "RGB"
3033

3134

@@ -34,4 +37,5 @@ def test_colorautoadjust_by_grayscale_with_alpha(setup):
3437
os.path.join(".", "tests", "pic", "test.png"),
3538
)
3639
image = Processor(image=image, colorautoadjust=True).process()
40+
image.show()
3741
assert image.mode == "L"

tests/test_colorstretch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def test_colorstretch_by_rgb(setup):
1010
os.path.join(".", "tests", "pic", "dog.jpg"),
1111
)
1212
image = Processor(image=image, colorstretch=True).process()
13+
image.show()
1314
assert image.mode == "RGB"
1415

1516

@@ -18,6 +19,7 @@ def test_colorstretch_by_grayscale(setup):
1819
os.path.join(".", "tests", "pic", "tokyo_station.jpg"),
1920
)
2021
image = Processor(image=image, colorstretch=True).process()
22+
image.show()
2123
assert image.mode == "L"
2224

2325

@@ -26,6 +28,7 @@ def test_colorstretch_by_rgba(setup):
2628
os.path.join(".", "tests", "pic", "nullpo.png"),
2729
)
2830
image = Processor(image=image, colorstretch=True).process()
31+
image.show()
2932
assert image.mode == "RGB"
3033

3134

@@ -34,4 +37,5 @@ def test_colorstretch_by_grayscale_with_alpha(setup):
3437
os.path.join(".", "tests", "pic", "test.png"),
3538
)
3639
image = Processor(image=image, colorstretch=True).process()
40+
image.show()
3741
assert image.mode == "L"

tests/test_contrast.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def test_contrast_by_rgb(setup):
1010
os.path.join(".", "tests", "pic", "dog.jpg"),
1111
)
1212
image = Processor(image=image, contrast=1.2).process()
13+
image.show()
1314
assert image.mode == "RGB"
1415

1516

@@ -18,6 +19,7 @@ def test_contrast_by_grayscale(setup):
1819
os.path.join(".", "tests", "pic", "tokyo_station.jpg"),
1920
)
2021
image = Processor(image=image, contrast=1.2).process()
22+
image.show()
2123
assert image.mode == "L"
2224

2325

@@ -26,6 +28,7 @@ def test_contrast_by_rgba(setup):
2628
os.path.join(".", "tests", "pic", "nullpo.png"),
2729
)
2830
image = Processor(image=image, contrast=1.2).process()
31+
image.show()
2932
assert image.mode == "RGB"
3033

3134

@@ -34,4 +37,5 @@ def test_contrast_by_grayscale_with_alpha(setup):
3437
os.path.join(".", "tests", "pic", "test.png"),
3538
)
3639
image = Processor(image=image, contrast=1.2).process()
40+
image.show()
3741
assert image.mode == "L"

tests/test_cyanotype.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def test_cyanotype_by_rgb(setup):
1010
os.path.join(".", "tests", "pic", "dog.jpg"),
1111
)
1212
image = Processor(image=image, grayscale=True, cyanotype=True).process()
13+
image.show()
1314
assert image.mode == "RGB"
1415

1516

@@ -18,6 +19,7 @@ def test_cyanotype_by_grayscale(setup):
1819
os.path.join(".", "tests", "pic", "tokyo_station.jpg"),
1920
)
2021
image = Processor(image=image, grayscale=True, cyanotype=True).process()
22+
image.show()
2123
assert image.mode == "RGB"
2224

2325

@@ -26,6 +28,7 @@ def test_cyanotype_by_rgba(setup):
2628
os.path.join(".", "tests", "pic", "nullpo.png"),
2729
)
2830
image = Processor(image=image, grayscale=True, cyanotype=True).process()
31+
image.show()
2932
assert image.mode == "RGB"
3033

3134

@@ -34,6 +37,7 @@ def test_cyanotype_by_grayscale_with_alpha(setup):
3437
os.path.join(".", "tests", "pic", "test.png"),
3538
)
3639
image = Processor(image=image, grayscale=True, cyanotype=True).process()
40+
image.show()
3741
assert image.mode == "RGB"
3842

3943

@@ -42,6 +46,7 @@ def test_cyanotype_by_rgb_using_tosaka_mode(setup):
4246
os.path.join(".", "tests", "pic", "dog.jpg"),
4347
)
4448
image = Processor(image=image, tosaka=2.4, cyanotype=True).process()
49+
image.show()
4550
assert image.mode == "RGB"
4651

4752

@@ -50,6 +55,7 @@ def test_cyanotype_by_grayscale_using_tosaka_mode(setup):
5055
os.path.join(".", "tests", "pic", "tokyo_station.jpg"),
5156
)
5257
image = Processor(image=image, tosaka=2.4, cyanotype=True).process()
58+
image.show()
5359
assert image.mode == "RGB"
5460

5561

@@ -58,6 +64,7 @@ def test_cyanotype_by_rgba_using_tosaka_mode(setup):
5864
os.path.join(".", "tests", "pic", "nullpo.png"),
5965
)
6066
image = Processor(image=image, tosaka=2.4, cyanotype=True).process()
67+
image.show()
6168
assert image.mode == "RGB"
6269

6370

@@ -66,6 +73,7 @@ def test_cyanotype_by_grayscale_with_alpha_using_tosaka_mode(setup):
6673
os.path.join(".", "tests", "pic", "test.png"),
6774
)
6875
image = Processor(image=image, tosaka=2.4, cyanotype=True).process()
76+
image.show()
6977
assert image.mode == "RGB"
7078

7179

@@ -74,6 +82,7 @@ def test_cyanotype_by_rgb_with_none_grayscale_option(setup):
7482
os.path.join(".", "tests", "pic", "dog.jpg"),
7583
)
7684
image = Processor(image=image, cyanotype=True).process()
85+
image.show()
7786
assert image.mode == "RGB"
7887

7988

@@ -82,6 +91,7 @@ def test_cyanotype_by_grayscale_with_none_grayscale_option(setup):
8291
os.path.join(".", "tests", "pic", "tokyo_station.jpg"),
8392
)
8493
image = Processor(image=image, cyanotype=True).process()
94+
image.show()
8595
assert image.mode == "RGB"
8696

8797

@@ -90,6 +100,7 @@ def test_cyanotype_by_rgba_with_none_grayscale_option(setup):
90100
os.path.join(".", "tests", "pic", "nullpo.png"),
91101
)
92102
image = Processor(image=image, cyanotype=True).process()
103+
image.show()
93104
assert image.mode == "RGB"
94105

95106

@@ -98,4 +109,5 @@ def test_cyanotype_by_grayscale_with_alpha_with_none_grayscale_option(setup):
98109
os.path.join(".", "tests", "pic", "test.png"),
99110
)
100111
image = Processor(image=image, cyanotype=True).process()
112+
image.show()
101113
assert image.mode == "RGB"

tests/test_grayscale.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def test_grayscale_by_rgb(setup):
1010
os.path.join(".", "tests", "pic", "dog.jpg"),
1111
)
1212
image = Processor(image=image, grayscale=True).process()
13+
image.show()
1314
assert image.mode == "L"
1415

1516

@@ -18,6 +19,7 @@ def test_grayscale_by_grayscale(setup):
1819
os.path.join(".", "tests", "pic", "tokyo_station.jpg"),
1920
)
2021
image = Processor(image=image, grayscale=True).process()
22+
image.show()
2123
assert image.mode == "L"
2224

2325

@@ -26,6 +28,7 @@ def test_grayscale_by_rgba(setup):
2628
os.path.join(".", "tests", "pic", "nullpo.png"),
2729
)
2830
image = Processor(image=image, grayscale=True).process()
31+
image.show()
2932
assert image.mode == "L"
3033

3134

@@ -34,4 +37,5 @@ def test_grayscale_by_grayscale_with_alpha(setup):
3437
os.path.join(".", "tests", "pic", "test.png"),
3538
)
3639
image = Processor(image=image, grayscale=True).process()
40+
image.show()
3741
assert image.mode == "L"

tests/test_invert.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def test_invert_by_rgb(setup):
1010
os.path.join(".", "tests", "pic", "dog.jpg"),
1111
)
1212
image = Processor(image=image, invert=True).process()
13+
image.show()
1314
assert image.mode == "RGB"
1415

1516

@@ -18,6 +19,7 @@ def test_invert_by_grayscale(setup):
1819
os.path.join(".", "tests", "pic", "tokyo_station.jpg"),
1920
)
2021
image = Processor(image=image, invert=True).process()
22+
image.show()
2123
assert image.mode == "L"
2224

2325

@@ -26,6 +28,7 @@ def test_invert_by_rgba(setup):
2628
os.path.join(".", "tests", "pic", "nullpo.png"),
2729
)
2830
image = Processor(image=image, invert=True).process()
31+
image.show()
2932
assert image.mode == "RGB"
3033

3134

@@ -34,4 +37,5 @@ def test_invert_by_grayscale_with_alpha(setup):
3437
os.path.join(".", "tests", "pic", "test.png"),
3538
)
3639
image = Processor(image=image, invert=True).process()
40+
image.show()
3741
assert image.mode == "L"

tests/test_line_drawing.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def test_line_drawing_by_rgb(setup):
1010
os.path.join(".", "tests", "pic", "dog.jpg"),
1111
)
1212
image = Processor(image=image, line_drawing=True).process()
13+
image.show()
1314
assert image.mode == "L"
1415

1516

@@ -18,6 +19,7 @@ def test_line_drawing_by_grayscale(setup):
1819
os.path.join(".", "tests", "pic", "tokyo_station.jpg"),
1920
)
2021
image = Processor(image=image, line_drawing=True).process()
22+
image.show()
2123
assert image.mode == "L"
2224

2325

@@ -26,6 +28,7 @@ def test_line_drawing_by_rgba(setup):
2628
os.path.join(".", "tests", "pic", "nullpo.png"),
2729
)
2830
image = Processor(image=image, line_drawing=True).process()
31+
image.show()
2932
assert image.mode == "L"
3033

3134

@@ -34,6 +37,7 @@ def test_line_drawing_by_grayscale_with_alpha(setup):
3437
os.path.join(".", "tests", "pic", "test.png"),
3538
)
3639
image = Processor(image=image, line_drawing=True).process()
40+
image.show()
3741
assert image.mode == "L"
3842

3943

@@ -42,6 +46,7 @@ def test_inverted_line_drawing_by_rgb(setup):
4246
os.path.join(".", "tests", "pic", "dog.jpg"),
4347
)
4448
image = Processor(image=image, line_drawing=True, invert=True).process()
49+
image.show()
4550
assert image.mode == "L"
4651

4752

@@ -50,6 +55,7 @@ def test_inverted_line_drawing_by_grayscale(setup):
5055
os.path.join(".", "tests", "pic", "tokyo_station.jpg"),
5156
)
5257
image = Processor(image=image, line_drawing=True, invert=True).process()
58+
image.show()
5359
assert image.mode == "L"
5460

5561

@@ -58,6 +64,7 @@ def test_inverted_line_drawing_by_rgba(setup):
5864
os.path.join(".", "tests", "pic", "nullpo.png"),
5965
)
6066
image = Processor(image=image, line_drawing=True, invert=True).process()
67+
image.show()
6168
assert image.mode == "L"
6269

6370

@@ -66,4 +73,5 @@ def test_inverted_line_drawing_by_grayscale_with_alpha(setup):
6673
os.path.join(".", "tests", "pic", "test.png"),
6774
)
6875
image = Processor(image=image, line_drawing=True, invert=True).process()
76+
image.show()
6977
assert image.mode == "L"

0 commit comments

Comments
 (0)