There are some clear minor mistakes in asyncio locks test case: Duplicate statements and wrong assert function.
The duplicate statements (L846 and L850) might be intentional but the assert function (L856) is obviously wrong.
|
await asyncio.sleep(0) |
|
self.assertEqual(0, sem._value) |
|
self.assertEqual(3, len(result)) |
|
self.assertTrue(sem.locked()) |
|
self.assertEqual(1, len(sem._waiters)) |
|
self.assertEqual(0, sem._value) |
|
|
|
self.assertTrue(t1.done()) |
|
self.assertTrue(t1.result()) |
|
race_tasks = [t2, t3, t4] |
|
done_tasks = [t for t in race_tasks if t.done() and t.result()] |
|
self.assertTrue(2, len(done_tasks)) |
There are some clear minor mistakes in asyncio locks test case: Duplicate statements and wrong assert function.
The duplicate statements (L846 and L850) might be intentional but the assert function (L856) is obviously wrong.
cpython/Lib/test/test_asyncio/test_locks.py
Lines 845 to 856 in 5185956