def main():
colorama.init(autoreset=True)
parser = argparse.ArgumentParser()
parser.add_argument('testfile', type=lambda x: is_valid_file_path(parser, x),
help='Start with a Testfile')
parser.add_argument('-v', '--validate', action='store_const', default=run_test, const=run_validation, dest='func',
help='Validates Testfile')
parser.add_argument('-m', '--iterations', type=int, default=None,
help='Changes the number of iterations that nuts waits for a result')
parser.add_argument('-r', '--retries', default=None, type=int,
help='Set the max retries for failed tests')
parser.add_argument('-c', '--config', type=lambda x: is_valid_file_path(parser, x), default=None,
help='Config file formatted as YAML. Settings will be merged with ENVVARs')
parser.add_argument('-d', '--debug', action='store_true', default=False,
help='Debug mode vor STDOUT and log files.')
args = parser.parse_args()
load_settings(config_file=args.config, retries=args.retries, iterations=args.iterations, debug=args.debug)
setup_logger()
result = args.func(testfile=args.testfile)
if not result:
exit(1)
评论列表
文章目录