Fix typos in comments and test code (#122846)

This commit is contained in:
Xie Yanbo 2024-08-12 12:16:41 +08:00 committed by GitHub
parent 9375b9ca3a
commit 253c6a0b2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 28 additions and 28 deletions

View file

@ -1194,14 +1194,14 @@ class SemaphoreTests(unittest.IsolatedAsyncioTestCase):
self.assertEqual([2, 3], result)
async def test_acquire_fifo_order_4(self):
# Test that a successfule `acquire()` will wake up multiple Tasks
# Test that a successful `acquire()` will wake up multiple Tasks
# that were waiting in the Semaphore queue due to FIFO rules.
sem = asyncio.Semaphore(0)
result = []
count = 0
async def c1(result):
# First task immediatlly waits for semaphore. It will be awoken by c2.
# First task immediately waits for semaphore. It will be awoken by c2.
self.assertEqual(sem._value, 0)
await sem.acquire()
# We should have woken up all waiting tasks now.
@ -1475,7 +1475,7 @@ class BarrierTests(unittest.IsolatedAsyncioTestCase):
# first time waiting
await barrier.wait()
# after wainting once for all tasks
# after waiting once for all tasks
if rewait_n > 0:
rewait_n -= 1
# wait again only for rewait tasks