def METHOD_NAME(self):
    # be sure args are handled properly
    atexit.register(h1)
    atexit.register(h4)
    atexit.register(h4, 4, kw="abc")
    atexit._run_exitfuncs()
    self.assertEqual(self.stream.getvalue(),
                        "h4 (4,) {'kw': 'abc'}\nh4 () {}\nh1\n")