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