]> granicus.if.org Git - python/commitdiff
Close #25367: Fix test_coroutines with no thread support
authorVictor Stinner <victor.stinner@gmail.com>
Sun, 11 Oct 2015 08:10:31 +0000 (10:10 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Sun, 11 Oct 2015 08:10:31 +0000 (10:10 +0200)
Skip test_asyncio_1() when the asyncio module cannot be imported because
CPython is compiled with no thread support.

Lib/test/test_coroutines.py

index 10de85644ee46709558bd0722fdefcaf094c869f..71fbe8212fbdd86a6e048b55f3c184315f5f51d3 100644 (file)
@@ -1322,7 +1322,9 @@ class CoroutineTest(unittest.TestCase):
 class CoroAsyncIOCompatTest(unittest.TestCase):
 
     def test_asyncio_1(self):
-        import asyncio
+        # asyncio cannot be imported when Python is compiled without thread
+        # support
+        support.import_module('asyncio')
 
         class MyException(Exception):
             pass