summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/async_case.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/unittest/async_case.py')
-rw-r--r--Lib/unittest/async_case.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/unittest/async_case.py b/Lib/unittest/async_case.py
index 63ff6a5..bd06eb3 100644
--- a/Lib/unittest/async_case.py
+++ b/Lib/unittest/async_case.py
@@ -90,9 +90,13 @@ class IsolatedAsyncioTestCase(TestCase):
self._callAsync(self.asyncSetUp)
def _callTestMethod(self, method):
- if self._callMaybeAsync(method) is not None:
- warnings.warn(f'It is deprecated to return a value that is not None from a '
- f'test case ({method})', DeprecationWarning, stacklevel=4)
+ result = self._callMaybeAsync(method)
+ if result is not None:
+ msg = (
+ f'It is deprecated to return a value that is not None '
+ f'from a test case ({method} returned {type(result).__name__!r})',
+ )
+ warnings.warn(msg, DeprecationWarning, stacklevel=4)
def _callTearDown(self):
self._callAsync(self.asyncTearDown)