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

Method test_empty_cell_preserved

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

Source from the content-addressed store, hash-verified

306 )
307
308 def test_empty_cell_preserved(self):
309 def f():
310 if False: # pragma: no cover
311 cell = None
312
313 def g():
314 cell # NameError, unbound free variable
315
316 return g
317
318 g1 = f()
319 with pytest.raises(NameError):
320 g1()
321
322 g2 = pickle_depickle(g1, protocol=self.protocol)
323 with pytest.raises(NameError):
324 g2()
325
326 def test_unhashable_closure(self):
327 def f():

Callers

nothing calls this directly

Calls 2

fFunction · 0.85
pickle_depickleFunction · 0.85

Tested by

no test coverage detected