MCPcopy Index your code
hub / github.com/cloudpipe/cloudpickle / test_empty_cell_preserved

Method test_empty_cell_preserved

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

fFunction · 0.85
pickle_depickleFunction · 0.85

Tested by

no test coverage detected