mirror of
https://github.com/python/cpython
synced 2024-10-14 09:58:30 +00:00
bpo-32733: Make test_coroutines robust against -Werror (GH-5487)
This commit is contained in:
parent
461d225b19
commit
2efb973589
|
@ -2152,15 +2152,10 @@ def a2():
|
|||
|
||||
def check(depth, msg):
|
||||
sys.set_coroutine_origin_tracking_depth(depth)
|
||||
with warnings.catch_warnings(record=True) as wlist:
|
||||
with self.assertWarns(RuntimeWarning) as cm:
|
||||
a2()
|
||||
support.gc_collect()
|
||||
# This might be fragile if other warnings somehow get triggered
|
||||
# inside our 'with' block... let's worry about that if/when it
|
||||
# happens.
|
||||
self.assertTrue(len(wlist) == 1)
|
||||
self.assertIs(wlist[0].category, RuntimeWarning)
|
||||
self.assertEqual(msg, str(wlist[0].message))
|
||||
self.assertEqual(msg, str(cm.warning))
|
||||
|
||||
orig_depth = sys.get_coroutine_origin_tracking_depth()
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue