Alexander Borzunov 4 年之前
父節點
當前提交
34808ddc67
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      tests/test_util_modules.py

+ 3 - 3
tests/test_util_modules.py

@@ -520,15 +520,15 @@ async def test_asyncio_utils():
     assert await afirst(as_aiter(), -1) == -1
     assert await afirst(as_aiter(1, 2, 3)) == 1
 
-    async def iterate(delays):
+    async def iterate_with_delays(delays):
         for i, delay in enumerate(delays):
             await asyncio.sleep(delay)
             yield i
 
-    async for _ in aiter_with_timeout(iterate([0.1] * 5), timeout=0.2):
+    async for _ in aiter_with_timeout(iterate_with_delays([0.1] * 5), timeout=0.2):
         pass
 
-    sleepy_aiter = iterate([0.1, 0.1, 0.3, 0.1, 0.1])
+    sleepy_aiter = iterate_with_delays([0.1, 0.1, 0.3, 0.1, 0.1])
     num_steps = 0
     with pytest.raises(asyncio.TimeoutError):
         async for _ in aiter_with_timeout(sleepy_aiter, timeout=0.2):