"""
Test that if foreign code provides a class that conforms to
BidirectionalMapping's interface, it is automatically a subclass.
"""
from bidict import BidirectionalMapping


class DumbBidirectionalMapping(dict):
    def __inverted__(self):
        for (key, val) in self.items():
            yield (val, key)

    @property
    def inv(self):
        return DumbBidirectionalMapping(self.__inverted__())


def test_subclasshook():
    assert issubclass(DumbBidirectionalMapping, BidirectionalMapping)
    assert not issubclass(dict, BidirectionalMapping)

@@ -401,16 +401,205 @@
 __())%0A%0A%0A
+class OldstyleClass():%0A    %22%22%22%0A    Old-style class (not derived from object).%0A    This used to crash due to missing __mro__ attribute that is not present%0A    in oldstyle classes.%0A    %22%22%22%0A%0A%0A
 def test
@@ -719,28 +719,91 @@
 dict, BidirectionalMapping)%0A
+    assert not issubclass(OldstyleClass, BidirectionalMapping)%0A

Add test for oldstyle class handling