def METHOD_NAME(self):
    class C:
        def __setattr__(self, name, value):
            object.__setattr__(self, name, value)
    try:  C().x = 1
    except TypeError: pass
    else: self.fail("should have thrown: can't apply this __setattr__ to instance object")
    class C:
        def __getattr__(self, name):
            object.__getattribute__(self, name)
    self.assertRaisesMessage(AttributeError, "'instance' object has no attribute 'x'", lambda: C().x)