Expect the test to be "short" but don't measure the exact performance
of the CI. SHORT_TIMEOUT is about 30 seconds whereas the cancelled
coroutine takes around 1 hour.
import asyncio
import unittest
import time
+from test import support
def tearDownModule():
nonlocal foo_running
foo_running = True
try:
- await asyncio.sleep(10)
+ await asyncio.sleep(support.LONG_TIMEOUT)
finally:
foo_running = False
return 'done'
self.assertTrue(fut.done())
# it should have been cancelled due to the timeout
self.assertTrue(fut.cancelled())
- self.assertLess(t1 - t0, 0.5)
+ self.assertLess(t1 - t0, support.SHORT_TIMEOUT)
self.assertEqual(foo_running, False)
async def test_wait_for_blocking(self):