diff options
author | Laurent Peuch <cortex@worlddomination.be> | 2020-05-06 14:20:08 +0200 |
---|---|---|
committer | Laurent Peuch <cortex@worlddomination.be> | 2020-05-06 14:20:08 +0200 |
commit | 324419e23b73f2269fff4d44e1457d7d3bfbf66d (patch) | |
tree | e0ddff710df5b40726b751bc8dc377454b18995f /test/test_registry.py | |
parent | 49dc54a7c761ca4acbef6d2104f8a45a1d5a9cb1 (diff) | |
download | logilab-common-324419e23b73f2269fff4d44e1457d7d3bfbf66d.tar.gz |
[deprecation/fix] correctly automatically get the module in which deprecation utils are called
There was a missmatched combination of:
* the frame wasn't always correctly grabbed
* grabbing the frame in the situation of a decorator didn't make any sens, so
switch to func.__module__
* the tests were bad and expected "[logilab.common]" while it should have been
"[test_deprecation]" because it was there that the depreciation was declared
Diffstat (limited to 'test/test_registry.py')
-rw-r--r-- | test/test_registry.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/test_registry.py b/test/test_registry.py index 148bf77..377ec48 100644 --- a/test/test_registry.py +++ b/test/test_registry.py @@ -189,11 +189,13 @@ class RegistryStoreTC(TestCase): with warnings.catch_warnings(record=True) as warns: store.register_objects([self.datapath('regobjects.py'), self.datapath('regobjects2.py')]) - self.assertIn('[logilab.common] 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'])) + self.assertIn( + "[logilab.common.registry] use register_modnames() instead", + [str(w.message) for w in warns], + ) def test_autoload_modnames(self): store = RegistryStore() |