Passed
Push — master ( 7596de...7d2c3d )
by Simon
04:29
created

tests._test_progress_board   A

Complexity

Total Complexity 0

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 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