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

Method test_unhashable_closure

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

Source from the content-addressed store, hash-verified

324 g2()
325
326 def test_unhashable_closure(self):
327 def f():
328 s = {1, 2} # mutable set is unhashable
329
330 def g():
331 return len(s)
332
333 return g
334
335 g = pickle_depickle(f(), protocol=self.protocol)
336 self.assertEqual(g(), 2)
337
338 def test_class_no_firstlineno_deletion_(self):
339 # `__firstlineno__` is a new attribute of classes introduced in Python 3.13.

Callers

nothing calls this directly

Calls 3

pickle_depickleFunction · 0.85
fFunction · 0.85
gFunction · 0.70

Tested by

no test coverage detected