code: def test_minus_x_overridden_by_maxfail(
      self, pytester: Pytester
  ) -> None:
      pytester.makepyfile(__init__="")
      pytester.makepyfile(
          test_one="xxxx", test_two="yyyy", test_third="zzz"
      )
      reprec = pytester.inline_run("-x", "--maxfail=2", pytester.path)
      finished = reprec.getreports("pytest_collectreport")
      colfail = [x for x in finished if x.failed]
      assert len(colfail) == 2
  
imports: import pytest
  from _pytest.config import ExitCode
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.pytester import Pytester
label_desc: Use image node_id 4 for calling the TestNewSession obj's underlying member method code with example usage: obj.test_minus_x_overridden_by_maxfail(pytester) without return types