Add test for oldstyle class handling

This commit is contained in:
Jozef Knaperek 2017-03-13 18:22:56 +01:00 committed by jab
parent 97f59b96a2
commit 287719c22d
1 changed files with 9 additions and 0 deletions

View File

@ -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)