bpo-45238: Fix unittest.IsolatedAsyncioTestCase.debug() (GH-28449)

It runs now asynchronous methods and callbacks.

If it fails, doCleanups() can be called for cleaning up.
This commit is contained in:
Serhiy Storchaka 2021-09-22 18:43:23 +03:00 committed by GitHub
parent 58f8adfda3
commit ecb6922ff2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 180 additions and 65 deletions

View file

@ -655,12 +655,12 @@ class TestCase(object):
or getattr(testMethod, '__unittest_skip_why__', ''))
raise SkipTest(skip_why)
self.setUp()
testMethod()
self.tearDown()
self._callSetUp()
self._callTestMethod(testMethod)
self._callTearDown()
while self._cleanups:
function, args, kwargs = self._cleanups.pop(-1)
function(*args, **kwargs)
function, args, kwargs = self._cleanups.pop()
self._callCleanup(function, *args, **kwargs)
def skipTest(self, reason):
"""Skip this test."""