code: def test_maxfail(self, pytester: Pytester) -> None:
      reprec = pytester.inline_runsource(
          """
              def test_one(): assert 0
              def test_two(): assert 0
              def test_three(): assert 0
          """,
          "--maxfail=2",
      )
      passed, skipped, failed = reprec.countoutcomes()
      assert failed == 2
      assert passed == skipped == 0
  
imports: import pytest
  from _pytest.config import ExitCode
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.pytester import Pytester
label_desc: Use image node_id 6 for calling the SessionTests obj's underlying member method code with example usage: obj.test_maxfail(pytester) without return types