diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2020-01-07 14:55:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-07 14:55:19 (GMT) |
commit | 4112a3da2e01ecc19e9f54b8ac7b383b6f5e85c8 (patch) | |
tree | 00241da39d605a863f909a7827467ce618b5195f /Lib/test/test_asyncio | |
parent | a6b37589a05c63abec122d3a00785641a3bcd85a (diff) | |
download | cpython-4112a3da2e01ecc19e9f54b8ac7b383b6f5e85c8.zip cpython-4112a3da2e01ecc19e9f54b8ac7b383b6f5e85c8.tar.gz cpython-4112a3da2e01ecc19e9f54b8ac7b383b6f5e85c8.tar.bz2 |
[3.8] bpo-39191: Fix RuntimeWarning in asyncio test (GH-17863) (#17894)
https://bugs.python.org/issue39191.
(cherry picked from commit 10ac0cded26d91c3468e5e5a87cecad7fc0bcebd)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r-- | Lib/test/test_asyncio/test_events.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index b0ade1e..aec56da 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -258,8 +258,12 @@ class EventLoopTestsMixin: self.assertTrue(self.loop.is_running()) self.loop.run_until_complete(coro1()) - self.assertRaises( - RuntimeError, self.loop.run_until_complete, coro2()) + with self.assertWarnsRegex( + RuntimeWarning, + r"coroutine \S+ was never awaited" + ): + self.assertRaises( + RuntimeError, self.loop.run_until_complete, coro2()) # Note: because of the default Windows timing granularity of # 15.6 msec, we use fairly long sleep times here (~100 msec). |