mirror of
https://github.com/python/cpython.git
synced 2025-08-14 22:01:08 +00:00
[3.9] bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968) (GH-27970)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 7dc505b865
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
2cdbd3b8b2
commit
970533e65c
6 changed files with 14 additions and 7 deletions
|
@ -3196,15 +3196,18 @@ class GenericTaskTests(test_utils.TestCase):
|
|||
def test_future_subclass(self):
|
||||
self.assertTrue(issubclass(asyncio.Task, asyncio.Future))
|
||||
|
||||
@support.cpython_only
|
||||
def test_asyncio_module_compiled(self):
|
||||
# Because of circular imports it's easy to make _asyncio
|
||||
# module non-importable. This is a simple test that will
|
||||
# fail on systems where C modules were successfully compiled
|
||||
# (hence the test for _functools), but _asyncio somehow didn't.
|
||||
# (hence the test for _functools etc), but _asyncio somehow didn't.
|
||||
try:
|
||||
import _functools
|
||||
import _json
|
||||
import _pickle
|
||||
except ImportError:
|
||||
pass
|
||||
self.skipTest('C modules are not available')
|
||||
else:
|
||||
try:
|
||||
import _asyncio
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue