Added answers to the report

This commit is contained in:
SwiftyOS
2023-09-13 10:40:55 +02:00
parent b2fc8f2a06
commit bacd0e5e4e
2 changed files with 6 additions and 2 deletions

View File

@@ -313,7 +313,8 @@ def pytest_runtest_makereport(item: Any, call: Any) -> None:
)
if call.when == "call":
generate_single_call_report(item, call, challenge_data)
answers = getattr(item, 'answers', None)
generate_single_call_report(item, call, challenge_data, answers)
if call.when == "teardown":
finalize_reports(item, challenge_data)

View File

@@ -53,7 +53,7 @@ def update_regression_tests(
def generate_single_call_report(
item: Any, call: Any, challenge_data: dict[str, Any]
item: Any, call: Any, challenge_data: dict[str, Any], answers: dict[str, Any]
) -> None:
try:
difficulty = challenge_data["info"]["difficulty"]
@@ -87,6 +87,9 @@ def generate_single_call_report(
},
# "answers": answers,
}
if answers:
info_details["answers"] = answers
if "metadata" in challenge_data:
info_details["metadata"] = challenge_data["metadata"]