'Make sure we handle classes with a custom nasty __getattr__ right.
With a custom __getattr__ which e.g. returns a function (like with a
RPC wrapper), we shouldn\'t assume this meant "__test__ = True".'

def test_class_with_nasty_getattr(self, testdir):

    testdir.makepyfile("\n                                                class    MetaModel(type):\n\n                                                                def    __getattr__(cls,    key):\n                                                                                return    lambda:    None\n\n\n                                                BaseModel    =    MetaModel('Model',    (),    {})\n\n\n                                                class    Model(BaseModel):\n\n                                                                __metaclass__    =    MetaModel\n\n                                                                def    test_blah(self):\n                                                                                pass\n                                ")
    reprec = testdir.inline_run()
    assert (not reprec.getfailedcollections())
    call = reprec.getcalls('pytest_collection_modifyitems')[0]
    assert (not call.items)
