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

This commit is contained in:
2025-07-20 23:19:45 +02:00
parent 83b4414e5c
commit 575c75d230
+5 -12
View File
@@ -1,8 +1,7 @@
# conftest.py
'''
import json
import os
'''
def safe_serialize(obj):
try:
json.dumps(obj)
@@ -33,7 +32,6 @@ all_data = {
def pytest_sessionstart(session):
all_data["session"] = serialize_object(session)
print("pytest_sessionstart called.")
def pytest_runtest_makereport(item, call):
if call.when != "call":
@@ -45,17 +43,12 @@ def pytest_runtest_makereport(item, call):
"item": item_dump,
"call": call_dump
})
print(f"pytest_runtest_makereport called for {item.nodeid}.")
def pytest_sessionfinish(session, exitstatus):
output_dir = os.path.abspath("ci-reports/markdown")
os.makedirs(output_dir, exist_ok=True)
print(f"Directory 'ci-reports/markdown' created or already exists at {output_dir}.")
with open(os.path.join(output_dir, "runtime_params.json"), "w") as f:
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(all_data, f, indent=2)
print(f"pytest_sessionfinish called, runtime_params.json saved to {output_dir}.")
'''
import json
@@ -113,4 +106,4 @@ def pytest_runtest_makereport(item, call):
def pytest_sessionfinish(session, exitstatus):
os.makedirs("ci-reports/markdown", exist_ok=True)
with open("ci-reports/markdown/runtime_params.json", "w") as f:
json.dump(runtime_params, f, indent=2)
json.dump(runtime_params, f, indent=2)