def METHOD_NAME():
    class A:
        def __init__(self):
            self.state = 0
            forksafe.register(self.after_fork)
        def after_fork(self):
            self.state = 1
        def method(self):
            return self.state
    a = A()
    pid = os.fork()
    if pid == 0:
        # child
        assert a.method() == 1
        os._exit(12)
    else:
        assert a.method() == 0
    _, status = os.waitpid(pid, 0)
    exit_code = os.WEXITSTATUS(status)
    assert exit_code == 12