mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-41322: added deprecation warning for tests returning value!=None (GH-27748)
This commit is contained in:
parent
0fd66e46b2
commit
3db42fc5ac
3 changed files with 10 additions and 2 deletions
|
@ -546,7 +546,9 @@ class TestCase(object):
|
|||
self.setUp()
|
||||
|
||||
def _callTestMethod(self, method):
|
||||
method()
|
||||
if method() is not None:
|
||||
warnings.warn(f'It is deprecated to return a value!=None from a '
|
||||
f'test case ({method})', DeprecationWarning)
|
||||
|
||||
def _callTearDown(self):
|
||||
self.tearDown()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue