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