MCPcopy Index your code
hub / github.com/python/cpython / testClosedIteratorDeadlock

Method testClosedIteratorDeadlock

Lib/test/test_bz2.py:248–255  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

246 self.assertEqual(list(iter(bz2f)), self.TEXT_LINES * 5)
247
248 def testClosedIteratorDeadlock(self):
249 # Issue #3309: Iteration on a closed BZ2File should release the lock.
250 self.createTempFile()
251 bz2f = BZ2File(self.filename)
252 bz2f.close()
253 self.assertRaises(ValueError, next, bz2f)
254 # This call will deadlock if the above call failed to release the lock.
255 self.assertRaises(ValueError, bz2f.readlines)
256
257 def testWrite(self):
258 with BZ2File(self.filename, "w") as bz2f:

Callers

nothing calls this directly

Calls 4

createTempFileMethod · 0.95
closeMethod · 0.95
BZ2FileClass · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected