def METHOD_NAME(self):
    class X:
        pass
    co = find_code_object(self.METHOD_NAME.__code__.co_consts)
    self.assertEqual('X', co.co_name, "Expected code object with name 'X'")
    self.assertFalse('__class__' in co.co_cellvars, "__class__ should not be in cellvars of X") 
    self.assertFalse('__class__' in co.co_freevars, "__class__ should not be in freevars of X")