(self)
| 391 | self.assertFalse(lock.locked()) |
| 392 | |
| 393 | def test_locked_with_2threads(self): |
| 394 | # see gh-134323: check that a rlock which |
| 395 | # is acquired in a different thread, |
| 396 | # is still locked in the main thread. |
| 397 | result = [] |
| 398 | rlock = self.locktype() |
| 399 | self.assertFalse(rlock.locked()) |
| 400 | def acquire(): |
| 401 | result.append(rlock.locked()) |
| 402 | rlock.acquire() |
| 403 | result.append(rlock.locked()) |
| 404 | |
| 405 | with Bunch(acquire, 1): |
| 406 | pass |
| 407 | self.assertTrue(rlock.locked()) |
| 408 | self.assertFalse(result[0]) |
| 409 | self.assertTrue(result[1]) |
| 410 | |
| 411 | def test_release_save_unacquired(self): |
| 412 | # Cannot _release_save an unacquired lock |
nothing calls this directly
no test coverage detected