MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_altitude_enum

Function test_altitude_enum

tests/test_native_enum.py:328–337  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

326 # only one that touches `m.altitude` or calls `m.bind_altitude`.
327
328 def test_altitude_enum():
329 # Logic copied from test_enum_type / test_enum_members.
330 # We don't test altitude there to avoid possible clashes if
331 # parallelizing against other tests in this file, and we also
332 # don't want to hold any references to the enumerators that
333 # would prevent GCing the enum type below.
334 assert isinstance(m.altitude, enum.EnumMeta)
335 assert m.altitude.__module__ == m.__name__
336 for name, value in ALTITUDE_MEMBERS:
337 assert m.altitude[name].value == value
338
339 def test_altitude_binding():
340 assert m.is_high_altitude(m.altitude.high)

Calls 1

isinstanceFunction · 0.85

Tested by

no test coverage detected