diff options
author | Nicolas Chauvat <nicolas.chauvat@logilab.fr> | 2009-07-31 22:10:43 +0200 |
---|---|---|
committer | Nicolas Chauvat <nicolas.chauvat@logilab.fr> | 2009-07-31 22:10:43 +0200 |
commit | 3c12ec55d34392fab45246f55a76fa03b2692b28 (patch) | |
tree | 8110971dcd11a4cec8037a46a7dd8634677ba609 /test | |
parent | 506b3cdacb4542801e5f5da1f2706e643194ef0e (diff) | |
download | logilab-common-3c12ec55d34392fab45246f55a76fa03b2692b28.tar.gz |
R [deprecation] deprecated_function deprecated in favor of deprecated
Diffstat (limited to 'test')
-rw-r--r-- | test/unittest_deprecation.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/test/unittest_deprecation.py b/test/unittest_deprecation.py index f03585b..844cd18 100644 --- a/test/unittest_deprecation.py +++ b/test/unittest_deprecation.py @@ -18,23 +18,27 @@ class RawInputTC(TestCase): def tearDown(self): warnings.simplefilter("default") + def mk_func(self): + def any_func(): + pass + return any_func + def test_class_deprecated(self): class AnyClass: __metaclass__ = deprecation.class_deprecated - def test_deprecated_function(self): - def any_func(): - pass - any_func = deprecation.deprecated_function(any_func) + def test_deprecated_func(self): + any_func = deprecation.deprecated()(self.mk_func()) any_func() - any_func = deprecation.deprecated_function(any_func,'message') + any_func = deprecation.deprecated('message')(self.mk_func()) any_func() + + def test_deprecated_decorator(self): @deprecation.deprecated_function def any_func(): pass any_func() - def test_deprecated(self): @deprecation.deprecated() def any_func(): pass |