def test_DeprecatedWarning_not_raised(self):
ret_val = "lololol"
class Test(object):
@deprecation.deprecated(deprecated_in="2.0",
removed_in="3.0",
current_version="1.0")
def method(self):
"""method docstring"""
return ret_val
with warnings.catch_warnings(record=True):
# If a warning is raised it'll be an exception, so we'll fail.
warnings.simplefilter("error")
sot = Test()
self.assertEqual(sot.method(), ret_val)
评论列表
文章目录