bpo-41322: Add unit tests for deprecation of test return values (GH-27846)

Also fix the traceback of warnings.
This commit is contained in:
andrei kulakov 2021-08-22 14:32:45 -04:00 committed by GitHub
parent 6dd1cdb0cf
commit b1db308c61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 50 additions and 2 deletions

View file

@ -548,7 +548,7 @@ class TestCase(object):
def _callTestMethod(self, method):
if method() is not None:
warnings.warn(f'It is deprecated to return a value!=None from a '
f'test case ({method})', DeprecationWarning)
f'test case ({method})', DeprecationWarning, stacklevel=3)
def _callTearDown(self):
self.tearDown()