]> granicus.if.org Git - python/commitdiff
bpo-37323: Suppress DeprecationWarning raised by @asyncio.coroutine (GH-14293)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 22 Jun 2019 10:43:07 +0000 (03:43 -0700)
committerGitHub <noreply@github.com>
Sat, 22 Jun 2019 10:43:07 +0000 (03:43 -0700)
When the test is ran with `PYTHONWARNINGS=error` the environment variable is passed to the python interpreter used in `assert_python_ok` where `DeprecationWarning` from  `@asyncio.coroutine` is converted into an error. Ignore the `DeprecationWarning` in `assert_python_ok`.

https://bugs.python.org/issue37323
(cherry picked from commit 186f70905d07b42a9cbf0a29e448f30baf2b53cb)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
Lib/test/test_asyncio/test_tasks.py

index 22a49077d5e7f1a9903eeb8a3a563db901c6a7f4..d5f44b8091de6bed450dbf9087180e3c2109d50e 100644 (file)
@@ -3352,7 +3352,9 @@ class CompatibilityTests(test_utils.TestCase):
 
             asyncio.run(old_style_coro())
         """)
-        assert_python_ok("-c", code, PYTHONASYNCIODEBUG="1")
+
+        assert_python_ok("-Wignore::DeprecationWarning", "-c", code,
+                         PYTHONASYNCIODEBUG="1")
 
 
 if __name__ == '__main__':