docstr: #4445: Make sure the warning points to a reasonable location
  See origin of _issue_warning_captured at: _pytest.config.__init__.py:910
docstr_tok: ["#","4445",":","Make","sure","the","warning","points","to","a","reasonable","location","See","origin","of","_issue_warning_captured","at",":","_pytest.config.__init__.py:910"]
code: def test_issue4445_preparse(
      self, pytester: Pytester, capwarn
  ) -> None:
      """#4445: Make sure the warning points to a reasonable location
      See origin of _issue_warning_captured at: _pytest.config.__init__.py:910
      """
      pytester.makeconftest(
          """
              import nothing
              """
      )
      pytester.parseconfig("--help")
  
      # with stacklevel=2 the warning should originate from config._preparse and is
      # thrown by an erroneous conftest.py
      assert len(capwarn.captured) == 1
      warning, location = capwarn.captured.pop()
      file, _, func = location
  
      assert "could not load initial conftests" in str(warning.message)
      assert f"config{os.sep}__init__.py" in file
      assert func == "_preparse"
  
imports: import os
  import sys
  import warnings
  from typing import List
  from typing import Optional
  from typing import Tuple
  import pytest
  from _pytest.fixtures import FixtureRequest
  from _pytest.pytester import Pytester
label_desc: Use image node_id 3 for calling the TestStackLevel obj's underlying member method code with example usage: obj.test_issue4445_preparse(pytester, capwarn) without return types