summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLaurent Peuch <cortex@worlddomination.be>2020-04-23 05:09:02 +0200
committerLaurent Peuch <cortex@worlddomination.be>2020-04-23 05:09:02 +0200
commit7ca6839754660e1cefa0544b00491cc9b023e8ab (patch)
tree4b00be0ffcb70500fc0b13208d0ae712b49bb263 /test
parentd26a1b969f632b5511bd72c82a36fbc92ecfdee5 (diff)
downloadlogilab-common-7ca6839754660e1cefa0544b00491cc9b023e8ab.tar.gz
add deprecation.argument_removed
Diffstat (limited to 'test')
-rw-r--r--test/unittest_deprecation.py11
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