diff options
author | Laurent Peuch <cortex@worlddomination.be> | 2020-04-23 05:09:02 +0200 |
---|---|---|
committer | Laurent Peuch <cortex@worlddomination.be> | 2020-04-23 05:09:02 +0200 |
commit | 7ca6839754660e1cefa0544b00491cc9b023e8ab (patch) | |
tree | 4b00be0ffcb70500fc0b13208d0ae712b49bb263 /test | |
parent | d26a1b969f632b5511bd72c82a36fbc92ecfdee5 (diff) | |
download | logilab-common-7ca6839754660e1cefa0544b00491cc9b023e8ab.tar.gz |
add deprecation.argument_removed
Diffstat (limited to 'test')
-rw-r--r-- | test/unittest_deprecation.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unittest_deprecation.py b/test/unittest_deprecation.py index 7881252..60b10f4 100644 --- a/test/unittest_deprecation.py +++ b/test/unittest_deprecation.py @@ -107,6 +107,17 @@ class RawInputTC(TestCase): with self.assertRaises(ValueError): some_function(new=42, old=42) + def test_argument_removed(self): + @deprecation.argument_removed("old") + def some_function(new): + return new + + self.assertEqual(some_function(new=42), 42) + self.assertEqual(some_function(new=10, old=20), 10) + self.assertEqual(self.messages, + ['argument old of callable some_function has been removed and is ' + 'deprecated']) + def test_renamed(self): def any_func(): pass |