def runtest(*argv): with patch("sys.argv", ["runtest"] + list(argv)): with patch("sys.exit", MockExit()) as mockexit: with patch("sys.stderr", StringIO()) as mockerr: from itest.main import main main() return mockexit.exitcode, mockerr.getvalue()
from itest import main main.main()
from itest.main import main main()