def test_exact_teardown_issue1206(self, pytester: Pytester) -> None:
        """Issue shadowing error with wrong number of arguments on teardown_method."""
        rec = pytester.inline_runsource(
            """
            import pytest

            class TestClass(object):
                def teardown_method(self, x, y, z):
                    pass

                def test_method(self):
                    assert True
        """
        )
        reps = rec.getreports("pytest_runtest_logreport")
        print(reps)
        assert len(reps) == 3
        #
        assert reps[0].nodeid.endswith("test_method")
        assert reps[0].passed
        assert reps[0].when == "setup"
        #
        assert reps[1].nodeid.endswith("test_method")
        assert reps[1].passed
        assert reps[1].when == "call"
        #
        assert reps[2].nodeid.endswith("test_method")
        assert reps[2].failed
        assert reps[2].when == "teardown"
        longrepr = reps[2].longrepr
        assert isinstance(longrepr, ExceptionChainRepr)
        assert longrepr.reprcrash
        assert longrepr.reprcrash.message in (
            "TypeError: teardown_method() missing 2 required positional arguments: 'y' and 'z'",
            # Python >= 3.10
            "TypeError: TestClass.teardown_method() missing 2 required positional arguments: 'y' and 'z'",
        )
Issue shadowing error with wrong number of arguments on teardown_method.
testing/test_runner.py