code: def test_lastfailed_failedfirst_order(
      self, pytester: Pytester
  ) -> None:
      pytester.makepyfile(
          test_a="def test_always_passes(): assert 1",
          test_b="def test_always_fails(): assert 0",
      )
      result = pytester.runpytest()
      # Test order will be collection order; alphabetical
      result.stdout.fnmatch_lines(["test_a.py*", "test_b.py*"])
      result = pytester.runpytest("--lf", "--ff")
      # Test order will be failing tests first
      result.stdout.fnmatch_lines(["test_b.py*"])
      result.stdout.no_fnmatch_line("*test_a.py*")
  
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 3 for calling the TestLastFailed obj's underlying member method code with example usage: obj.test_lastfailed_failedfirst_order(pytester) without return types