Update json_to_md.py
Run Pytest / tests (push) Successful in 26s

This commit is contained in:
2025-07-21 01:18:20 +02:00
parent 6022fa9acd
commit 2d66eca7b9
+6 -3
View File
@@ -76,20 +76,22 @@ def make_test_block(test, status, emoji, level, runtime_params):
callspec = runtime_params.get(nodeid, {})
params = callspec.get("params", {}) if isinstance(callspec, dict) else {}
# Résumé du test
summary = f"{emoji} Test {test['global_number']}"
if params:
param_display = ", ".join(f"{k}={sanitize_param_value(v)}" for k, v in params.items())
summary += f"<br><span style='color: #888; font-size: 0.9em;'>(params: {param_display})</span>"
# Ajouter les runtime parameters avant les autres phases
body = ""
if callspec:
block = f"```python\n{stringify(callspec)}\n```"
body += f"**📌 Runtime Parameters**\n\n{block}\n\n"
# Parcours des phases du test
skip_keys = {"nodeid", "global_number"}
for phase in [k for k in test if isinstance(test[k], dict) and k not in skip_keys]:
body += f"**_*{phase.capitalize()} phase*_**\n\n"
body += f"**_*📌 {phase.capitalize()} phase*_**\n\n"
for field, value in test[phase].items():
block = stringify(value)
body += f"**{field}:**\n\n```python\n{block}\n```\n\n"
@@ -103,6 +105,7 @@ def make_test_block(test, status, emoji, level, runtime_params):
f"{body_content}\n"
f" </details>\n\n"
)
def json_to_md_nested(json_path, md_path, runtime_params=None):
with open(json_path) as f: