28 lines
737 B
Python
28 lines
737 B
Python
# conftest.py
|
|
|
|
import json
|
|
import os
|
|
|
|
runtime_params = []
|
|
|
|
def pytest_runtest_makereport(item, call):
|
|
if call.when != "call":
|
|
return
|
|
|
|
entry = {"nodeid": item.nodeid, "params": {}}
|
|
|
|
if hasattr(item, "callspec"):
|
|
entry["params"] = item.callspec.params
|
|
else:
|
|
request = getattr(item, "_request", None)
|
|
if request and hasattr(request, "funcargs"):
|
|
entry["params"] = request.funcargs
|
|
|
|
runtime_params.append(entry)
|
|
|
|
def pytest_sessionfinish(session, exitstatus):
|
|
os.makedirs("ci-reports/markdown", exist_ok=True)
|
|
print("✅ Dumping runtime_params.json...")
|
|
with open("ci-reports/markdown/runtime_params.json", "w") as f:
|
|
json.dump(runtime_params, f, indent=2)
|