mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-128729: Fix RuntimeWarning in test_unittest (GH-128730)
This commit is contained in:
parent
30268b5d2f
commit
cb72feb8a3
1 changed files with 3 additions and 0 deletions
|
@ -347,7 +347,10 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
with self.assertWarns(DeprecationWarning) as w:
|
with self.assertWarns(DeprecationWarning) as w:
|
||||||
|
warnings.filterwarnings('ignore',
|
||||||
|
'coroutine .* was never awaited', RuntimeWarning)
|
||||||
Foo('test1').run()
|
Foo('test1').run()
|
||||||
|
support.gc_collect()
|
||||||
self.assertIn('It is deprecated to return a value that is not None', str(w.warning))
|
self.assertIn('It is deprecated to return a value that is not None', str(w.warning))
|
||||||
self.assertIn('test1', str(w.warning))
|
self.assertIn('test1', str(w.warning))
|
||||||
self.assertEqual(w.filename, __file__)
|
self.assertEqual(w.filename, __file__)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue