summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhilippe Pepiot <philippe.pepiot@logilab.fr>2017-01-20 16:10:51 +0100
committerPhilippe Pepiot <philippe.pepiot@logilab.fr>2017-01-20 16:10:51 +0100
commit742fe7dda53fc4fbe5ccf8e1827ab6bbe5af95f0 (patch)
treea728f3235ec5a428eb0b75de03d4bf99a903a6dd /test
parent1f42d92dbca788c4ab7750ae8359b974134cf595 (diff)
downloadlogilab-common-742fe7dda53fc4fbe5ccf8e1827ab6bbe5af95f0.tar.gz
[registry] deprecate register_objects()
This method is to be replaced by register_modnames() to avoid using deprecated modpath_from_file()
Diffstat (limited to 'test')
-rw-r--r--test/unittest_registry.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/unittest_registry.py b/test/unittest_registry.py
index c322e05..8c5c791 100644
--- a/test/unittest_registry.py
+++ b/test/unittest_registry.py
@@ -23,6 +23,7 @@ import os.path as osp
import sys
from operator import eq, lt, le, gt
from contextlib import contextmanager
+import warnings
logging.basicConfig(level=logging.ERROR)
@@ -177,8 +178,11 @@ class RegistryStoreTC(TestCase):
store = RegistryStore()
store.setdefault('zereg')
with prepended_syspath(self.datadir):
- store.register_objects([self.datapath('regobjects.py'),
- self.datapath('regobjects2.py')])
+ with warnings.catch_warnings(record=True) as warns:
+ store.register_objects([self.datapath('regobjects.py'),
+ self.datapath('regobjects2.py')])
+ self.assertIn('use register_modnames() instead',
+ [str(w.message) for w in warns])
self.assertEqual(['zereg'], list(store.keys()))
self.assertEqual(set(('appobject1', 'appobject2', 'appobject3')),
set(store['zereg']))