diff options
Diffstat (limited to 'Lib/test/test_coroutines.py')
-rw-r--r-- | Lib/test/test_coroutines.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index 8d1e069..145adb6 100644 --- a/Lib/test/test_coroutines.py +++ b/Lib/test/test_coroutines.py @@ -7,6 +7,8 @@ import types import unittest import warnings from test import support +from test.support import import_helper +from test.support import warnings_helper from test.support.script_helper import assert_python_ok @@ -2117,7 +2119,7 @@ class CoroAsyncIOCompatTest(unittest.TestCase): def test_asyncio_1(self): # asyncio cannot be imported when Python is compiled without thread # support - asyncio = support.import_module('asyncio') + asyncio = import_helper.import_module('asyncio') class MyException(Exception): pass @@ -2258,8 +2260,9 @@ class OriginTrackingTest(unittest.TestCase): try: warnings._warn_unawaited_coroutine = lambda coro: 1/0 with support.catch_unraisable_exception() as cm, \ - support.check_warnings((r'coroutine .* was never awaited', - RuntimeWarning)): + warnings_helper.check_warnings( + (r'coroutine .* was never awaited', + RuntimeWarning)): # only store repr() to avoid keeping the coroutine alive coro = corofn() coro_repr = repr(coro) @@ -2272,8 +2275,8 @@ class OriginTrackingTest(unittest.TestCase): self.assertEqual(cm.unraisable.exc_type, ZeroDivisionError) del warnings._warn_unawaited_coroutine - with support.check_warnings((r'coroutine .* was never awaited', - RuntimeWarning)): + with warnings_helper.check_warnings( + (r'coroutine .* was never awaited', RuntimeWarning)): corofn() support.gc_collect() |