def METHOD_NAME(self):
    l = []
    atexit.register(l.append, 5)
    atexit._run_exitfuncs()
    self.assertEqual(l, [5])
    atexit.unregister(l.append)
    atexit._run_exitfuncs()
    self.assertEqual(l, [5])