def test_pdb_teardown_skipped_for_functions(
    pytester: Pytester, monkeypatch: MonkeyPatch, mark: str
) -> None:
    """
    With --pdb, setUp and tearDown should not be called for tests skipped
    via a decorator (#7215).
    """
    tracked: list[str] = []
    monkeypatch.setattr(pytest, "track_pdb_teardown_skipped", tracked, raising=False)

    pytester.makepyfile(
        f"""
        import unittest
        import pytest

        class MyTestCase(unittest.TestCase):

            def setUp(self):
                pytest.track_pdb_teardown_skipped.append("setUp:" + self.id())

            def tearDown(self):
                pytest.track_pdb_teardown_skipped.append("tearDown:" + self.id())

            {mark}("skipped for reasons")
            def test_1(self):
                pass

    """
    )
    result = pytester.runpytest_inprocess("--pdb")
    result.stdout.fnmatch_lines("* 1 skipped in *")
    assert tracked == []

    With --pdb, setUp and tearDown should not be called for tests skipped
    via a decorator (#7215).
    
testing/test_unittest.py