mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-97837: Change deprecation warning message in unittest
(#97838)
This commit is contained in:
parent
4e731814d7
commit
c3648f4e4a
5 changed files with 37 additions and 8 deletions
|
@ -88,7 +88,7 @@ class IsolatedAsyncioTestCase(TestCase):
|
|||
|
||||
def _callTestMethod(self, method):
|
||||
if self._callMaybeAsync(method) is not None:
|
||||
warnings.warn(f'It is deprecated to return a value!=None from a '
|
||||
warnings.warn(f'It is deprecated to return a value that is not None from a '
|
||||
f'test case ({method})', DeprecationWarning, stacklevel=4)
|
||||
|
||||
def _callTearDown(self):
|
||||
|
|
|
@ -577,7 +577,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 '
|
||||
warnings.warn(f'It is deprecated to return a value that is not None from a '
|
||||
f'test case ({method})', DeprecationWarning, stacklevel=3)
|
||||
|
||||
def _callTearDown(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue