Skip to content

Commit 9a37051

Browse files
authored
Improve features test coverage (#9077)
2 parents 54de168 + 31e6c71 commit 9a37051

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Tests/test_features.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,25 @@ def test_unsupported_module() -> None:
104104
features.version_module(module)
105105

106106

107+
def test_unsupported_feature() -> None:
108+
# Arrange
109+
feature = "unsupported_feature"
110+
# Act / Assert
111+
with pytest.raises(ValueError):
112+
features.check_feature(feature)
113+
with pytest.raises(ValueError):
114+
features.version_feature(feature)
115+
116+
117+
def test_unsupported_version() -> None:
118+
assert features.version("unsupported_version") is None
119+
120+
121+
def test_modulenotfound(monkeypatch: pytest.MonkeyPatch) -> None:
122+
monkeypatch.setattr(features, "features", {"test": ("PIL._test", "", "")})
123+
assert features.check_feature("test") is None
124+
125+
107126
@pytest.mark.parametrize("supported_formats", (True, False))
108127
def test_pilinfo(supported_formats: bool) -> None:
109128
buf = io.StringIO()

0 commit comments

Comments
 (0)