Your question is Automating a Repetitive Task. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
BetMGM QA engineers may repeatedly review smoke-test results to determine which checks fail most often. Write a function that automates this summary by counting failed executions for each test name.
Implement summarize_failures(results), where results is a list of dictionaries. Each dictionary contains:
test: a non-empty string identifying a BetMGM test casestatus: either "passed" or "failed"Return a dictionary mapping each test name that failed at least once to its number of failed executions. Ignore passing results. Preserve the order in which test names first appear in the output. If no test failed, return an empty dictionary.
def summarize_failures(results):