diff options
author | Laurent Peuch <cortex@worlddomination.be> | 2020-05-07 22:22:42 +0200 |
---|---|---|
committer | Laurent Peuch <cortex@worlddomination.be> | 2020-05-07 22:22:42 +0200 |
commit | 4a94989c06e8693be7bc3859418a0049d3ef4ae6 (patch) | |
tree | 6174858583c545e1f2da946132fc10e4fae25aa9 /test | |
parent | 95a99fdd10aae7ff0d30bd029d633dfe36689ad0 (diff) | |
download | logilab-common-4a94989c06e8693be7bc3859418a0049d3ef4ae6.tar.gz |
[fix] metaclass conflict for class_deprecated
Actually the old compatibility code actually prevented this bug so back it up.
Diffstat (limited to 'test')
-rw-r--r-- | test/unittest_deprecation.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unittest_deprecation.py b/test/unittest_deprecation.py index 096978e..172b9fb 100644 --- a/test/unittest_deprecation.py +++ b/test/unittest_deprecation.py @@ -61,6 +61,17 @@ class RawInputTC(TestCase): self.assertEqual(self.messages, ['[logilab.common] OldClass is deprecated, use AnyClass instead']) + def test_class_renamed_conflict_metaclass(self): + class SomeMetaClass(type): + pass + + class AnyClass(metaclass=SomeMetaClass): + pass + + # make sure the "metaclass conflict: the metaclass of a derived class # must be a + # (non-strict) subclass of the metaclasses of all its bases" exception won't be raised + deprecation.class_renamed("OldClass", AnyClass) + def test_class_moved(self): class AnyClass(object): pass |