def METHOD_NAME(self):
    mod = self.make_module("""
        #include <Python.h>
        HPyDef_METH(f, "f", HPyFunc_NOARGS)
        static HPy f_impl(HPyContext *ctx, HPy self)
        {
            PyObject *o = HPy_AsPyObject(ctx, HPy_NULL);
            if (o == NULL) {
                return HPy_Dup(ctx, ctx->h_True);
            }
            else {
                return HPy_Dup(ctx, ctx->h_False);
            }
        }
        @EXPORT(f)
        @INIT
    """)
    assert mod.f()