diff options
author | Philippe Pepiot <philippe.pepiot@logilab.fr> | 2017-01-20 16:10:51 +0100 |
---|---|---|
committer | Philippe Pepiot <philippe.pepiot@logilab.fr> | 2017-01-20 16:10:51 +0100 |
commit | 742fe7dda53fc4fbe5ccf8e1827ab6bbe5af95f0 (patch) | |
tree | a728f3235ec5a428eb0b75de03d4bf99a903a6dd /test | |
parent | 1f42d92dbca788c4ab7750ae8359b974134cf595 (diff) | |
download | logilab-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.py | 8 |
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'])) |