docstr: #4445 and #5928: Make sure the warning from an unknown mark points to
  the test file where this mark is used.
docstr_tok: ["#","4445","and","#","5928",":","Make","sure","the","warning","from","an","unknown","mark","points","to","the","test","file","where","this","mark","is","used","."]
code: def test_issue4445_issue5928_mark_generator(
      self, pytester: Pytester
  ) -> None:
      """#4445 and #5928: Make sure the warning from an unknown mark points to
      the test file where this mark is used.
      """
      testfile = pytester.makepyfile(
          """
              import pytest
  
              @pytest.mark.unknown
              def test_it():
                  pass
              """
      )
      result = pytester.runpytest_subprocess()
      # with stacklevel=2 the warning should originate from the above created test file
      result.stdout.fnmatch_lines_random(
          [
              f"*{testfile}:3*",
              "*Unknown pytest.mark.unknown*",
          ]
      )
  
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 6 for calling the TestStackLevel obj's underlying member method code with example usage: obj.test_issue4445_issue5928_mark_generator(pytester) without return types