0
0
Testing Fundamentalstesting~10 mins

Test execution reporting in Testing Fundamentals - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to print the test execution result as 'PASS' or 'FAIL'.

Testing Fundamentals
result = 'PASS' if tests_passed else [1]
print(result)
Drag options to blanks, or click blank then click option'
A'SKIP'
B'DONE'
C'FAIL'
D'ERROR'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ERROR' or 'DONE' instead of 'FAIL' for failed tests.
Leaving the else part empty or incorrect.
2fill in blank
medium

Complete the code to count how many tests passed from the list of test results.

Testing Fundamentals
passed_count = sum(1 for result in test_results if result == [1])
Drag options to blanks, or click blank then click option'
A'ERROR'
B'PASS'
C'SKIP'
D'FAIL'
Attempts:
3 left
💡 Hint
Common Mistakes
Counting 'FAIL' or other statuses instead of 'PASS'.
Using incorrect string quotes or case.
3fill in blank
hard

Fix the error in the code that generates a summary report of test results.

Testing Fundamentals
summary = f"Total: {total_tests}, Passed: {passed}, Failed: {failed}, [1]: {skipped}"
Drag options to blanks, or click blank then click option'
ASkipped
BSkip
Cskip
DSKIP
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase or inconsistent capitalization for the label.
Using 'Skip' which is not the correct label.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps test names to their pass/fail status.

Testing Fundamentals
test_status = {test[1]: result == 'PASS' for test, result in test_results.items() if result [2] 'SKIP'}
Drag options to blanks, or click blank then click option'
A.upper()
B!=
C==
D.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of '!=' to filter skipped tests.
Not converting test names to uppercase.
5fill in blank
hard

Fill all three blanks to create a filtered report dictionary with test names in lowercase, results, and only passed tests.

Testing Fundamentals
filtered_report = {test[1]: result for test, result in report.items() if result [2] 'PASS' and test [3] 'test_1'}
Drag options to blanks, or click blank then click option'
A.lower()
B==
C!=
D.capitalize()
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' instead of '==' to check for passed tests.
Including 'test_1' instead of excluding it.