File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 7
7
from PIL import BlpImagePlugin , Image
8
8
9
9
from .helper import (
10
- assert_image_equal ,
11
10
assert_image_equal_tofile ,
12
- assert_image_similar ,
11
+ assert_image_similar_tofile ,
13
12
hopper ,
14
13
)
15
14
@@ -52,18 +51,16 @@ def test_save(tmp_path: Path) -> None:
52
51
im = hopper ("P" )
53
52
im .save (f , blp_version = version )
54
53
55
- with Image .open (f ) as reloaded :
56
- assert_image_equal (im .convert ("RGB" ), reloaded )
54
+ assert_image_equal_tofile (im .convert ("RGB" ), f )
57
55
58
56
with Image .open ("Tests/images/transparent.png" ) as im :
59
57
f = tmp_path / "temp.blp"
60
58
im .convert ("P" ).save (f , blp_version = version )
61
59
62
- with Image .open (f ) as reloaded :
63
- assert_image_similar (im , reloaded , 8 )
60
+ assert_image_similar_tofile (im , f , 8 )
64
61
65
62
im = hopper ()
66
- with pytest .raises (ValueError ):
63
+ with pytest .raises (ValueError , match = "Unsupported BLP image mode" ):
67
64
im .save (f )
68
65
69
66
You can’t perform that action at this time.
0 commit comments