MCPcopy Index your code
hub / github.com/python/cpython / test_rerun_async_setup_hook_failure

Method test_rerun_async_setup_hook_failure

Lib/test/test_regrtest.py:1733–1752  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1731 stats=2)
1732
1733 def test_rerun_async_setup_hook_failure(self):
1734 # FAILURE then FAILURE
1735 code = textwrap.dedent("""
1736 import unittest
1737
1738 class ExampleTests(unittest.IsolatedAsyncioTestCase):
1739 async def asyncSetUp(self):
1740 raise RuntimeError('Fail')
1741
1742 async def test_success(self):
1743 return
1744 """)
1745 testname = self.create_test(code=code)
1746
1747 output = self.run_tests("--rerun", testname, exitcode=EXITCODE_BAD_TEST)
1748 self.check_executed_tests(output, testname,
1749 rerun=Rerun(testname,
1750 match="test_success",
1751 success=False),
1752 stats=2)
1753
1754 def test_rerun_async_teardown_hook_failure(self):
1755 # FAILURE then FAILURE

Callers

nothing calls this directly

Calls 5

run_testsMethod · 0.95
RerunClass · 0.85
create_testMethod · 0.80
check_executed_testsMethod · 0.80
dedentMethod · 0.45

Tested by

no test coverage detected