diff --git a/tests/test_subclasshook.py b/tests/test_subclasshook.py index 369ce77..19e9cf1 100644 --- a/tests/test_subclasshook.py +++ b/tests/test_subclasshook.py @@ -15,6 +15,15 @@ class DumbBidirectionalMapping(dict): return DumbBidirectionalMapping(self.__inverted__()) +class OldstyleClass(): + """ + Old-style class (not derived from object). + This used to crash due to missing __mro__ attribute that is not present + in oldstyle classes. + """ + + def test_subclasshook(): assert issubclass(DumbBidirectionalMapping, BidirectionalMapping) assert not issubclass(dict, BidirectionalMapping) + assert not issubclass(OldstyleClass, BidirectionalMapping)