summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLaurent Peuch <cortex@worlddomination.be>2020-05-07 22:22:42 +0200
committerLaurent Peuch <cortex@worlddomination.be>2020-05-07 22:22:42 +0200
commit4a94989c06e8693be7bc3859418a0049d3ef4ae6 (patch)
tree6174858583c545e1f2da946132fc10e4fae25aa9 /test
parent95a99fdd10aae7ff0d30bd029d633dfe36689ad0 (diff)
downloadlogilab-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.py11
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