class_docstr: test pytest.deprecated_call()
class_docstr_tok: ["test","pytest.deprecated_call","(",")"]
docstr: Ensure deprecated_call() captures a deprecation warning as expected inside its
  block/function.
code: def test_deprecated_call_modes(
      self, warning_type, mode, call_f_first
  ) -> None:
      """Ensure deprecated_call() captures a deprecation warning as expected inside its
      block/function.
      """
  
      def f():
          warnings.warn(warning_type("hi"))
          return 10
  
      # ensure deprecated_call() can capture the warning even if it has already been triggered
      if call_f_first:
          assert f() == 10
      if mode == "call":
          assert pytest.deprecated_call(f) == 10
      else:
          with pytest.deprecated_call():
              assert f() == 10
  
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 10 for calling the TestDeprecatedCall obj's underlying member method code with example usage: obj.test_deprecated_call_modes(warning_type, mode, call_f_first) and returns: int