code: def test_recwarn_captures_deprecation_warning(
      recwarn: WarningsRecorder,
  ) -> None:
      """
      Check that recwarn can capture DeprecationWarning by default
      without custom filterwarnings (see #8666).
      """
      warnings.warn(DeprecationWarning("some deprecation"))
      assert len(recwarn) == 1
      assert recwarn.pop(DeprecationWarning)
  
imports: import warnings
  from typing import List
  from typing import Optional
  from typing import Type
  import pytest
  from _pytest.pytester import Pytester
  from _pytest.recwarn import WarningsRecorder
label_desc: Use image node_id 3 for calling a global function with example usage: test_recwarn_captures_deprecation_warning(recwarn) without return types