code: def test_lastfailed_with_all_filtered(
      self, pytester: Pytester
  ) -> None:
      pytester.makepyfile(
          **{
              "pkg1/test_1.py": """
                      def test_fail(): assert 0
                      def test_pass(): pass
                  """,
          }
      )
      result = pytester.runpytest()
      result.stdout.fnmatch_lines(
          ["collected 2 items", "* 1 failed, 1 passed in *"]
      )
      assert result.ret == 1
  
      # Remove known failure.
      pytester.makepyfile(
          **{
              "pkg1/test_1.py": """
                      def test_pass(): pass
                  """,
          }
      )
      result = pytester.runpytest("--lf", "--co")
      result.stdout.fnmatch_lines(
          [
              "collected 1 item",
              "run-last-failure: 1 known failures not in selected tests",
              "",
              "<Dir *>",
              "  <Dir pkg1>",
              "    <Module test_1.py>",
              "      <Function test_pass>",
              "",
              "*= 1 test collected in*",
          ],
          consecutive=True,
      )
      assert result.ret == 0
  
imports: import os
  import shutil
  from pathlib import Path
  from typing import Generator
  from typing import List
  import pytest
  from _pytest.config import ExitCode
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.pytester import Pytester
  from _pytest.tmpdir import TempPathFactory
label_desc: Use image node_id 26 for calling the TestLastFailed obj's underlying member method code with example usage: obj.test_lastfailed_with_all_filtered(pytester) without return types