(self)
| 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(): |
nothing calls this directly
no test coverage detected