def METHOD_NAME(self):
    a = [0]
    def inc():
        a[0] += 1
    def dec():
        a[0] -= 1
    for i in range(4):
        atexit.register(inc)
    atexit.register(dec)
    atexit.unregister(inc)
    atexit._run_exitfuncs()
    self.assertEqual(a[0], -1)