MCPcopy
hub / github.com/pytest-dev/pytest / test_assert_never_literal

Function test_assert_never_literal

testing/test_compat.py:178–192  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176
177
178def test_assert_never_literal() -> None:
179 x: Literal["a", "b"] = "a"
180
181 if x == "a":
182 pass
183 else:
184 with pytest.raises(AssertionError):
185 assert_never(x) # type: ignore[arg-type]
186
187 if x == "a":
188 pass
189 elif x == "b":
190 pass
191 else:
192 assert_never(x)
193
194
195def test_deprecated() -> None:

Callers

nothing calls this directly

Calls 1

assert_neverFunction · 0.90

Tested by

no test coverage detected