def test_testcase_handles_init_exceptions(pytester: Pytester) -> None:
    """
    Regression test to make sure exceptions in the __init__ method are bubbled up correctly.
    See https://github.com/pytest-dev/pytest/issues/3788
    """
    pytester.makepyfile(
        """
        from unittest import TestCase
        import pytest
        class MyTestCase(TestCase):
            def __init__(self, *args, **kwargs):
                raise Exception("should raise this exception")
            def test_hello(self):
                pass
    """
    )
    result = pytester.runpytest()
    assert "should raise this exception" in result.stdout.str()
    result.stdout.no_fnmatch_line("*ERROR at teardown of MyTestCase.test_hello*")

    Regression test to make sure exceptions in the __init__ method are bubbled up correctly.
    See https://github.com/pytest-dev/pytest/issues/3788
    
testing/test_unittest.py