def METHOD_NAME(self, report: TestReport) -> None:
    if report.failed:
        if self.skip:
            # Remove test from the failed ones (if it exists) and unset the skip option
            # to make sure the following tests will not be skipped.
            if report.nodeid == self.lastfailed:
                self.lastfailed = None
            self.skip = False
        else:
            # Mark test as the last failing and interrupt the test session.
            self.lastfailed = report.nodeid
            assert self.session is not None
            self.session.shouldstop = (
                "Test failed, continuing from this test next run."
            )
    else:
        # If the test was actually run and did pass.
        if report.when == "call":
            # Remove test from the failed ones, if exists.
            if report.nodeid == self.lastfailed:
                self.lastfailed = None