import asyncio
import inspect
+import warnings
from .case import TestCase
self._callAsync(self.asyncSetUp)
def _callTestMethod(self, method):
- self._callMaybeAsync(method)
+ if self._callMaybeAsync(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._callAsync(self.asyncTearDown)
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()
--- /dev/null
+Added ``DeprecationWarning`` for tests and async tests that return a
+value!=None (as this may indicate an improperly written test, for example a
+test written as a generator function).