Skip to content

Commit 4d441e8

Browse files
TheWesDiasRocky Allen
authored andcommitted
test: add test for unknown status (Kludex#3035)
1 parent 241fcf6 commit 4d441e8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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)