diff options
author | Nathaniel J. Smith <njs@pobox.com> | 2018-01-24 12:14:33 -0800 |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2018-01-24 15:14:33 -0500 |
commit | fb5a7ad421ac20c49218ee4b86fb0d85ca4cd664 (patch) | |
tree | 732c85b5d8ce04bb71c05a507cfe226e4c0fd248 /Lib/test | |
parent | 0a5e71b4c70aab87125a54d7a59765e18d7583a4 (diff) | |
download | cpython-git-fb5a7ad421ac20c49218ee4b86fb0d85ca4cd664.tar.gz |
bpo-32636: Fix @asyncio.coroutine debug mode bug exposed by gh-5250 (#5291)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_asyncio/test_tasks.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index daa1ff927e..5e83a54ff2 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -9,6 +9,7 @@ import io import random import re import sys +import textwrap import types import unittest import weakref @@ -3090,6 +3091,22 @@ class CompatibilityTests(test_utils.TestCase): result = self.loop.run_until_complete(inner()) self.assertEqual(['ok1', 'ok2'], result) + def test_debug_mode_interop(self): + # https://bugs.python.org/issue32636 + code = textwrap.dedent(""" + import asyncio + + async def native_coro(): + pass + + @asyncio.coroutine + def old_style_coro(): + yield from native_coro() + + asyncio.run(old_style_coro()) + """) + assert_python_ok("-c", code, PYTHONASYNCIODEBUG="1") + if __name__ == '__main__': unittest.main() |