def test_traceback_pruning(pytester: Pytester) -> None:
    """Regression test for #9610 - doesn't crash during traceback pruning."""
    pytester.makepyfile(
        """
        import unittest

        class MyTestCase(unittest.TestCase):
            def __init__(self, test_method):
                unittest.TestCase.__init__(self, test_method)

        class TestIt(MyTestCase):
            @classmethod
            def tearDownClass(cls) -> None:
                assert False

            def test_it(self):
                pass
        """
    )
    reprec = pytester.inline_run()
    passed, skipped, failed = reprec.countoutcomes()
    assert passed == 1
    assert failed == 1
    assert reprec.ret == 1
Regression test for #9610 - doesn't crash during traceback pruning.
testing/test_unittest.py