code: def test_shouldfail_is_sticky(pytester: Pytester) -> None:
      """Test that session.shouldfail cannot be reset to False after being set.
  
      Issue #11706.
      """
      pytester.makeconftest(
          """
          def pytest_sessionfinish(session):
              assert session.shouldfail
              session.shouldfail = False
              assert session.shouldfail
          """
      )
      pytester.makepyfile(
          """
          import pytest
  
          def test_foo():
              pytest.fail("This is a failing test")
  
          def test_bar(): pass
          """
      )
  
      result = pytester.runpytest("--maxfail=1", "-Wall")
  
      result.assert_outcomes(failed=1, warnings=1)
      result.stdout.fnmatch_lines(
          "*session.shouldfail cannot be unset*"
      )
  
imports: import pytest
  from _pytest.config import ExitCode
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.pytester import Pytester
label_desc: Use image node_id 10 for calling a global function with example usage: test_shouldfail_is_sticky(pytester) without return types