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

Function test_pickle_roundtrip

tests/test_native_enum.py:86–92  ·  view source on GitHub ↗
(enum_type, members)

Source from the content-addressed store, hash-verified

84
85@pytest.mark.parametrize(("enum_type", "members"), ENUM_TYPES_AND_MEMBERS)
86def test_pickle_roundtrip(enum_type, members):
87 for name, _ in members:
88 orig = enum_type[name]
89 # This only works if __module__ is correct.
90 serialized = pickle.dumps(orig)
91 restored = pickle.loads(serialized)
92 assert restored == orig
93
94
95@pytest.mark.parametrize("enum_type", [m.flags_uchar, m.flags_uint])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected