Skip to content

Commit e65d766

Browse files
committed
Don't duplicate py/c tests, timeout has no C accelerators
1 parent e8c67ce commit e65d766

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

Lib/test/test_asyncio/test_timeouts.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,7 @@ def tearDownModule():
1111
asyncio.set_event_loop_policy(None)
1212

1313

14-
class BaseTimeoutTests:
15-
Task = None
16-
17-
def new_task(self, loop, coro, name='TestTask'):
18-
return self.__class__.Task(coro, loop=loop, name=name)
19-
20-
def _setupAsyncioLoop(self):
21-
assert self._asyncioTestLoop is None, 'asyncio test loop already initialized'
22-
loop = asyncio.new_event_loop()
23-
asyncio.set_event_loop(loop)
24-
loop.set_debug(True)
25-
self._asyncioTestLoop = loop
26-
loop.set_task_factory(self.new_task)
27-
fut = loop.create_future()
28-
self._asyncioCallsTask = loop.create_task(self._asyncioLoopRunner(fut))
29-
loop.run_until_complete(fut)
14+
class TimeoutTests(unittest.IsolatedAsyncioTestCase):
3015

3116
async def test_timeout_basic(self):
3217
with self.assertRaises(TimeoutError):
@@ -240,15 +225,5 @@ async def test_nested_timeout_in_finally(self):
240225
await asyncio.sleep(10)
241226

242227

243-
@unittest.skipUnless(hasattr(tasks, '_CTask'),
244-
'requires the C _asyncio module')
245-
class Timeout_CTask_Tests(BaseTimeoutTests, unittest.IsolatedAsyncioTestCase):
246-
Task = getattr(tasks, '_CTask', None)
247-
248-
249-
class Timeout_PyTask_Tests(BaseTimeoutTests, unittest.IsolatedAsyncioTestCase):
250-
Task = tasks._PyTask
251-
252-
253228
if __name__ == '__main__':
254229
unittest.main()

0 commit comments

Comments
 (0)