code: def fail_if_not_removed(method):
      
  
      def _inner(*args, **kwargs):
          with warnings.catch_warnings(record=True) as caught_warnings:
              warnings.simplefilter("always")
              rval = method(*args, **kwargs)
  
          for warning in caught_warnings:
              if warning.category == UnsupportedWarning:
                  raise AssertionError(
                      ("%s uses a function that should be removed: %s" %
                       (method, str(warning.message))))
          return rval
  
      return _inner
docs: Decorate a test method to track removal of deprecated code
  
      This decorator catches :class:`~deprecation.UnsupportedWarning`
      warnings that occur during testing and causes unittests to fail,
      making it easier to keep track of when code should be removed.
  
      :raises: :class:`AssertionError` if an
               :class:`~deprecation.UnsupportedWarning`
               is raised while running the test method.