MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_assert_never_enum

Function test_assert_never_enum

testing/test_compat.py:231–246  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

229
230
231def test_assert_never_enum() -> None:
232 E = enum.Enum("E", "a b")
233 x: E = E.a
234
235 if x is E.a:
236 pass
237 else:
238 with pytest.raises(AssertionError):
239 assert_never(x) # type: ignore[arg-type]
240
241 if x is E.a:
242 pass
243 elif x is E.b:
244 pass
245 else:
246 assert_never(x)
247
248
249def test_assert_never_literal() -> None:

Callers

nothing calls this directly

Calls 1

assert_neverFunction · 0.90

Tested by

no test coverage detected