def METHOD_NAME(self, src):
    fname = self.tmpdir.join('test_api.h')
    # automatically add useful typedefs
    src = """
        #define STRINGIFY(X) #X
        #define HPy_ID(X) _Pragma(STRINGIFY(id=X)) \\
        typedef int HPy;
        typedef int HPyContext;
    """ + src
    fname.write(src)
    return HPyAPI.METHOD_NAME(fname)