Skip to content

Commit 3b7f0cb

Browse files
authored
test: add test for unknown status (#3035)
1 parent b09ce1a commit 3b7f0cb

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/test_status.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@ def test_deprecated_types(constant: str, msg: str) -> None:
2121
getattr(importlib.import_module("starlette.status"), constant)
2222
assert len(record) == 1
2323
assert msg in str(record.list[0])
24+
25+
26+
def test_unknown_status() -> None:
27+
with pytest.raises(
28+
AttributeError,
29+
match="module 'starlette.status' has no attribute 'HTTP_999_UNKNOWN_STATUS_CODE'",
30+
):
31+
getattr(importlib.import_module("starlette.status"), "HTTP_999_UNKNOWN_STATUS_CODE")

0 commit comments

Comments
 (0)