summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--markdown/util.py7
-rw-r--r--tests/test_apis.py2
2 files changed, 2 insertions, 7 deletions
diff --git a/markdown/util.py b/markdown/util.py
index 46cfe68..c31f6e2 100644
--- a/markdown/util.py
+++ b/markdown/util.py
@@ -423,6 +423,7 @@ class Registry:
else:
raise KeyError('Cannot delete key {}, not registered.'.format(key))
+ @deprecated('Use the `register` method instead.')
def add(self, key, value, location):
""" Register a key by location. """
if len(self) == 0:
@@ -459,12 +460,6 @@ class Registry:
raise ValueError('Not a valid location: "%s". Location key '
'must start with a ">" or "<".' % location)
self.register(value, key, priority)
- warnings.warn(
- 'Using the add method to register a processor or pattern is deprecated. '
- 'Use the `register` method instead.',
- DeprecationWarning,
- stacklevel=2,
- )
def __getattr__(name):
diff --git a/tests/test_apis.py b/tests/test_apis.py
index 16f3088..c977e6b 100644
--- a/tests/test_apis.py
+++ b/tests/test_apis.py
@@ -420,7 +420,7 @@ class RegistryTests(unittest.TestCase):
r.add('f', Item('f'), 'badlocation')
# Check the warnings
- self.assertEqual(len(w), 7)
+ self.assertEqual(len(w), 8)
self.assertTrue(all(issubclass(x.category, DeprecationWarning) for x in w))