-
Notifications
You must be signed in to change notification settings - Fork 0
/
lovetest.py
executable file
·36 lines (29 loc) · 1.14 KB
/
lovetest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python3
import argparse
from collector import find_test_files
from runner import run_tests
from file_parser import find_functions_in_files
from reporter import print_results
def parse_arguments():
parser = argparse.ArgumentParser(
description="Run specific Python tests or test files."
)
parser.add_argument("--files", nargs="*", help="Specify test files to run.")
parser.add_argument("--skip-files", nargs="*", help="Specify test files to skip.")
parser.add_argument("--functions", nargs="*", help="Specify test functions to run.")
parser.add_argument(
"--skip-functions", nargs="*", help="Specify test functions to skip."
)
return parser.parse_args()
if __name__ == "__main__":
args = parse_arguments()
files = args.files
skip_files = args.skip_files
functions = args.functions
skip_functions = args.skip_functions
verified_files = find_test_files(files=files, ignore=skip_files)
function_index = find_functions_in_files(
file_names=verified_files, functions=functions, ignore=skip_functions
)
report = run_tests(function_index)
print_results(report)