Skip to content

Commit 31e6c71

Browse files
committed
Improved features test coverage
1 parent 329d6a6 commit 31e6c71

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
@@ -112,6 +112,25 @@ def test_unsupported_module() -> None:
112112
features.version_module(module)
113113

114114

115+
def test_unsupported_feature() -> None:
116+
# Arrange
117+
feature = "unsupported_feature"
118+
# Act / Assert
119+
with pytest.raises(ValueError):
120+
features.check_feature(feature)
121+
with pytest.raises(ValueError):
122+
features.version_feature(feature)
123+
124+
125+
def test_unsupported_version() -> None:
126+
assert features.version("unsupported_version") is None
127+
128+
129+
def test_modulenotfound(monkeypatch: pytest.MonkeyPatch) -> None:
130+
monkeypatch.setattr(features, "features", {"test": ("PIL._test", "", "")})
131+
assert features.check_feature("test") is None
132+
133+
115134
@pytest.mark.parametrize("supported_formats", (True, False))
116135
def test_pilinfo(supported_formats: bool) -> None:
117136
buf = io.StringIO()

0 commit comments

Comments
 (0)