def METHOD_NAME(self):
    """Function decorated with `deprecate` should raise a warning."""
    @deprecate
    def foo(a):
        return 2*a
    @deprecate("use baz instead", version="0.2.0")
    def bar(a):
        return 4*a
    with warnings.catch_warnings(record=True) as w:
        self.assertEqual(foo(1), 2,
                         "Decorated function does not return original "
                         "return value")
    self.assertTrue(len(w) > 0, "No warning raised!")
    self.assertEqual(w[0].category, DeprecationWarning,
                    "Raised warning is not a DeprecationWarning")
    with warnings.catch_warnings(record=True) as w:
        self.assertEqual(bar(1), 4,
                         "Decorated function does not return original "
                         "return value")
    expected_message = "use baz instead. It is not guaranteed to be in " \
                       "service in vers. 0.2.0"
    self.assertTrue( w[0].message.args[0].endswith(expected_message),
                    "Warning message does not reflect decorator arguments.")
    @deprecate_soon
    def baz(a):
        return 3*a
    with warnings.catch_warnings(record=True) as w:
        self.assertEqual(baz(1), 3,
                         "Decorated function does not return original "
                         "return value")
    self.assertEqual(w[0].category, PendingDeprecationWarning,
                    "Raised warning is not a PendingDeprecationWarning")