MCPcopy Create free account
hub / github.com/cloudpipe/cloudpickle / test_dataclass

Method test_dataclass

tests/cloudpickle_test.py:2353–2360  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2351 assert mp == pickle_depickle(mp, protocol=self.protocol)
2352
2353 def test_dataclass(self):
2354 dataclasses = pytest.importorskip("dataclasses")
2355
2356 DataClass = dataclasses.make_dataclass("DataClass", [("x", int)])
2357 data = DataClass(x=42)
2358
2359 pickle_depickle(DataClass, protocol=self.protocol)
2360 assert data.x == pickle_depickle(data, protocol=self.protocol).x == 42
2361
2362 def test_locally_defined_enum(self):
2363 class StringEnum(str, enum.Enum):

Callers

nothing calls this directly

Calls 1

pickle_depickleFunction · 0.85

Tested by

no test coverage detected