docstr: Test deprecated_arg decorator raises exception with `removed` set in the past.
docstr_tok: ["Test","deprecated_arg","decorator","raises","exception","with","`","removed","`","set","in","the","past","."]
code: def test_arg_except2(self):
      """Test deprecated_arg decorator raises exception with `removed` set in the past."""
  
      @deprecated_arg(
          "b", removed=self.prev_version, version_val=self.test_version
      )
      def afoo4(a, b=None):
          pass
  
      self.assertRaises(DeprecatedError, lambda: afoo4(1, b=2))
  
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 15 for calling the TestDeprecated obj's underlying member method code with example usage: obj.test_arg_except2() without return types