diff options
author | Laurent Peuch <cortex@worlddomination.be> | 2020-04-23 04:00:22 +0200 |
---|---|---|
committer | Laurent Peuch <cortex@worlddomination.be> | 2020-04-23 04:00:22 +0200 |
commit | f502fe0496b292b433c6b2299698a180769c79c6 (patch) | |
tree | 52d774851015fc01f55417e5da11de65a58c88c8 /test | |
parent | 9ec44ee898ee827daab19265314117f27bc648de (diff) | |
download | logilab-common-f502fe0496b292b433c6b2299698a180769c79c6.tar.gz |
[deprecation/refactoring] remove totally overkill DeprecationManager
Diffstat (limited to 'test')
-rw-r--r-- | test/unittest_deprecation.py | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/test/unittest_deprecation.py b/test/unittest_deprecation.py index 5432823..dfe6b67 100644 --- a/test/unittest_deprecation.py +++ b/test/unittest_deprecation.py @@ -162,66 +162,6 @@ class RawInputTC(TestCase): self.assertEqual(self.messages, ['[logilab.common] object moving_target has been moved to module data.deprecation']) - def test_deprecated_manager(self): - deprecator = deprecation.DeprecationManager("module_name") - deprecator.compatibility('1.3') - # This warn should be printed. - deprecator.warn('1.1', "Major deprecation message.", 1) - deprecator.warn('1.1') - - @deprecator.deprecated('1.2', 'Major deprecation message.') - def any_func(): - pass - any_func() - - @deprecator.deprecated('1.2') - def other_func(): - pass - other_func() - - self.assertListEqual(self.messages, - ['[module_name 1.1] Major deprecation message.', - '[module_name 1.1] ', - '[module_name 1.2] Major deprecation message.', - '[module_name 1.2] The function "other_func" is deprecated']) - - def test_class_deprecated_manager(self): - deprecator = deprecation.DeprecationManager("module_name") - deprecator.compatibility('1.3') - class AnyClass(object, metaclass=deprecator.class_deprecated('1.2')): - pass - AnyClass() - self.assertEqual(self.messages, - ['[module_name 1.2] AnyClass is deprecated']) - - - def test_deprecated_manager_noprint(self): - deprecator = deprecation.DeprecationManager("module_name") - deprecator.compatibility('1.3') - # This warn should not be printed. - deprecator.warn('1.3', "Minor deprecation message.", 1) - - @deprecator.deprecated('1.3', 'Minor deprecation message.') - def any_func(): - pass - any_func() - - @deprecator.deprecated('1.20') - def other_func(): - pass - other_func() - - @deprecator.deprecated('1.4') - def other_func(): - pass - other_func() - - class AnyClass(object): - __metaclass__ = deprecator.class_deprecated((1,5)) - AnyClass() - - self.assertFalse(self.messages) - if __name__ == '__main__': unittest_main() |