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

Function test_assert_never_enum

testing/test_compat.py:160–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

158
159
160def test_assert_never_enum() -> None:
161 E = enum.Enum("E", "a b")
162 x: E = E.a
163
164 if x is E.a:
165 pass
166 else:
167 with pytest.raises(AssertionError):
168 assert_never(x) # type: ignore[arg-type]
169
170 if x is E.a:
171 pass
172 elif x is E.b:
173 pass
174 else:
175 assert_never(x)
176
177
178def test_assert_never_literal() -> None:

Callers

nothing calls this directly

Calls 1

assert_neverFunction · 0.90

Tested by

no test coverage detected