class_docstr: Note: all pytest runs are executed in a subprocess so we don't inherit warning filters
  from pytest's own test suite
class_docstr_tok: ["Note",":","all","pytest","runs","are","executed","in","a","subprocess","so","we","do","n't","inherit","warning","filters","from","pytest","'s","own","test","suite"]
docstr: Should hide the deprecation warning from the function, but the warning during collection should
  be displayed normally.
docstr_tok: ["Should","hide","the","deprecation","warning","from","the","function",",","but","the","warning","during","collection","should","be","displayed","normally","."]
code: def test_hidden_by_mark(self, pytester: Pytester) -> None:
      """Should hide the deprecation warning from the function, but the warning during collection should
      be displayed normally.
      """
      self.create_file(
          pytester,
          mark='@pytest.mark.filterwarnings("ignore::PendingDeprecationWarning")',
      )
      result = pytester.runpytest_subprocess()
      result.stdout.fnmatch_lines(
          [
              "*== %s ==*" % WARNINGS_SUMMARY_HEADER,
              "*test_hidden_by_mark.py:3: DeprecationWarning: collection",
              "* 1 passed, 1 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 TestDeprecationWarningsByDefault obj's underlying member method code with example usage: obj.test_hidden_by_mark(pytester) without return types