Files
slic/log_all_test_params.py
T
tligui_y b3c0969950
Run Pytest with HTML and XML Test Reports / tests (push) Failing after 21s
Update log_all_test_params.py
2025-07-16 14:50:01 +02:00

34 lines
1.0 KiB
Python

import os
import pprint
import sys
sys.path.append(os.path.dirname(__file__))
from extract_parametrize import extract_all_parametrize
def find_test_files(root_dir):
"""Retourne la liste des chemins vers les fichiers test_*.py dans root_dir"""
test_files = []
for dirpath, _, filenames in os.walk(root_dir):
for fname in filenames:
if fname.startswith("test_") and fname.endswith(".py"):
test_files.append(os.path.join(dirpath, fname))
return test_files
def extract_all_tests_params(root_dir):
all_params = {}
test_files = find_test_files(root_dir)
for filepath in test_files:
try:
param_data = extract_all_parametrize(filepath)
if param_data:
all_params[filepath] = param_data
except Exception as e:
print(f"❌ Erreur lors du parsing de {filepath} : {e}")
return all_params
if __name__ == "__main__":
result = extract_all_tests_params("tests")
pprint.pprint(result, sort_dicts=False)