def test_no_sys_import(self): b = """sys.exitfunc = f""" a = """atexit.register(f)""" msg = ("Can't find sys import; Please add an atexit import at the " "top of your file.") self.warns(b, a, msg)