bpo-41322: added deprecation warning for tests returning value!=None (GH-27748)

This commit is contained in:
andrei kulakov 2021-08-19 05:41:04 -04:00 committed by GitHub
parent 0fd66e46b2
commit 3db42fc5ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -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()