docstr: Warnings raised during importing of conftest.py files is captured (#2891).
docstr_tok: ["Warnings","raised","during","importing","of","conftest.py","files","is","captured","(","#","2891",")","."]
code: def test_conftest_warning_captured(self, pytester: Pytester) -> None:
      """Warnings raised during importing of conftest.py files is captured (#2891)."""
      pytester.makeconftest(
          """
              import warnings
              warnings.warn(UserWarning("my custom warning"))
              """
      )
      result = pytester.runpytest()
      result.stdout.fnmatch_lines(
          ["conftest.py:2", "*UserWarning: my custom warning*"]
      )
  
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 4 for calling the TestStackLevel obj's underlying member method code with example usage: obj.test_conftest_warning_captured(pytester) without return types