Total Complexity | 0 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import os, glob |
||
2 | import subprocess |
||
3 | from subprocess import DEVNULL, STDOUT |
||
4 | |||
5 | |||
6 | abspath = os.path.abspath(__file__) |
||
7 | dir_ = os.path.dirname(abspath) |
||
8 | |||
9 | files = glob.glob(dir_ + "/_progress_board_tests/_test_progress_board_*.py") |
||
10 | |||
11 | for file_path in files: |
||
12 | file_name = str(file_path.rsplit("/", maxsplit=1)[1]) |
||
13 | |||
14 | try: |
||
15 | print("\033[0;33;40m Testing", file_name, end="...\r") |
||
16 | subprocess.check_call(["pytest", file_path], stdout=DEVNULL, stderr=STDOUT) |
||
17 | except subprocess.CalledProcessError: |
||
18 | print("\033[0;31;40m Error in", file_name) |
||
19 | else: |
||
20 | print("\033[0;32;40m", file_name, "is correct") |
||
21 |