code: def test_nested_import_error(self, pytester: Pytester) -> None:
      tfile = pytester.makepyfile(
          """
              import import_fails
              def test_this():
                  assert import_fails.a == 1
          """,
          import_fails="""
              import does_not_work
              a = 1
          """,
      )
      reprec = pytester.inline_run(tfile)
      values = reprec.getfailedcollections()
      assert len(values) == 1
      out = str(values[0].longrepr)
      assert out.find("does_not_work") != -1
  
imports: import pytest
  from _pytest.config import ExitCode
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.pytester import Pytester
label_desc: Use image node_id 2 for calling the SessionTests obj's underlying member method code with example usage: obj.test_nested_import_error(pytester) without return types