docstr: Test deprecated decorator raises exception with `removed` set in the past.
docstr_tok: ["Test","deprecated","decorator","raises","exception","with","`","removed","`","set","in","the","past","."]
code: def test_except2(self):
      """Test deprecated decorator raises exception with `removed` set in the past."""
  
      @deprecated(
          removed=self.prev_version, version_val=self.test_version
      )
      def foo4():
          pass
  
      self.assertRaises(DeprecatedError, foo4)
  
imports: from __future__ import annotations
  import unittest
  import warnings
  from monai.utils import DeprecatedError, deprecated, deprecated_arg, deprecated_arg_default
label_desc: Use image node_id 5 for calling the TestDeprecated obj's underlying member method code with example usage: obj.test_except2() without return types