@@ -19,7 +19,7 @@ def test_check() -> None:
19
19
assert features .check_codec (codec ) == features .check (codec )
20
20
for feature in features .features :
21
21
if "webp" in feature :
22
- with pytest .warns (DeprecationWarning ):
22
+ with pytest .warns (DeprecationWarning , match = "webp" ):
23
23
assert features .check_feature (feature ) == features .check (feature )
24
24
else :
25
25
assert features .check_feature (feature ) == features .check (feature )
@@ -49,24 +49,24 @@ def test(name: str, function: Callable[[str], str | None]) -> None:
49
49
test (codec , features .version_codec )
50
50
for feature in features .features :
51
51
if "webp" in feature :
52
- with pytest .warns (DeprecationWarning ):
52
+ with pytest .warns (DeprecationWarning , match = "webp" ):
53
53
test (feature , features .version_feature )
54
54
else :
55
55
test (feature , features .version_feature )
56
56
57
57
58
58
def test_webp_transparency () -> None :
59
- with pytest .warns (DeprecationWarning ):
59
+ with pytest .warns (DeprecationWarning , match = "transp_webp" ):
60
60
assert (features .check ("transp_webp" ) or False ) == features .check_module ("webp" )
61
61
62
62
63
63
def test_webp_mux () -> None :
64
- with pytest .warns (DeprecationWarning ):
64
+ with pytest .warns (DeprecationWarning , match = "webp_mux" ):
65
65
assert (features .check ("webp_mux" ) or False ) == features .check_module ("webp" )
66
66
67
67
68
68
def test_webp_anim () -> None :
69
- with pytest .warns (DeprecationWarning ):
69
+ with pytest .warns (DeprecationWarning , match = "webp_anim" ):
70
70
assert (features .check ("webp_anim" ) or False ) == features .check_module ("webp" )
71
71
72
72
@@ -95,10 +95,9 @@ def test_check_codecs(feature: str) -> None:
95
95
96
96
97
97
def test_check_warns_on_nonexistent () -> None :
98
- with pytest .warns (UserWarning ) as cm :
98
+ with pytest .warns (UserWarning , match = "Unknown feature 'typo'." ) :
99
99
has_feature = features .check ("typo" )
100
100
assert has_feature is False
101
- assert str (cm [- 1 ].message ) == "Unknown feature 'typo'."
102
101
103
102
104
103
def test_supported_modules () -> None :
0 commit comments