import os, glob
import subprocess
from subprocess import DEVNULL, STDOUT


abspath = os.path.abspath(__file__)
dir_ = os.path.dirname(abspath)

files = glob.glob(dir_ + "/_progress_board_tests/_test_progress_board_*.py")

for file_path in files:
    file_name = str(file_path.rsplit("/", maxsplit=1)[1])

    try:
        print("\033[0;33;40m Testing", file_name, end="...\r")
        subprocess.check_call(["pytest", file_path], stdout=DEVNULL, stderr=STDOUT)
    except subprocess.CalledProcessError:
        print("\033[0;31;40m Error in", file_name)
    else:
        print("\033[0;32;40m", file_name, "is correct")

[((85, 110), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (100, 110), False, 'import os, glob\n'), ((118, 142), 'os.path.dirname', 'os.path.dirname', (['abspath'], {}), '(abspath)\n', (133, 142), False, 'import os, glob\n'), ((152, 220), 'glob.glob', 'glob.glob', (["(dir_ + '/_progress_board_tests/_test_progress_board_*.py')"], {}), "(dir_ + '/_progress_board_tests/_test_progress_board_*.py')\n", (161, 220), False, 'import os, glob\n'), ((385, 460), 'subprocess.check_call', 'subprocess.check_call', (["['pytest', file_path]"], {'stdout': 'DEVNULL', 'stderr': 'STDOUT'}), "(['pytest', file_path], stdout=DEVNULL, stderr=STDOUT)\n", (406, 460), False, 'import subprocess\n')]