-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report failed tests #10
Commits on Mar 18, 2023
-
add a smaller grained test for result formatting
Checklist: - Invoke tearDown even if the test method fails - Run multiple tests - Report failed tests 👈🏼 --- Output: ➜ python3 src/test_case_test.py Traceback (most recent call last): File "tdd-xunit-example/src/test_case_test.py", line 24, in <module> TestCaseTest("testFailedResultFormatting").run() File "tdd-xunit-example/src/test_case.py", line 17, in run method() File "tdd-xunit-example/src/test_case_test.py", line 19, in testFailedResultFormatting result.testFailed() ^^^^^^^^^^^^^^^^^ AttributeError: 'TestResult' object has no attribute 'testFailed'. Did you mean: 'testStarted'?
Configuration menu - View commit details
-
Copy full SHA for 06c9085 - Browse repository at this point
Copy the full SHA 06c9085View commit details -
implement
testFailed()
atTestResult
Checklist: - Invoke tearDown even if the test method fails - Run multiple tests - Report failed tests 👈🏼 --- Output: Traceback (most recent call last): File "tdd-xunit-example/src/test_case_test.py", line 24, in <module> TestCaseTest("testFailedResultFormatting").run() File "tdd-xunit-example/src/test_case.py", line 17, in run method() File "tdd-xunit-example/src/test_case_test.py", line 20, in testFailedResultFormatting assert ("1 run, 1 failed" == result.summary()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError
Configuration menu - View commit details
-
Copy full SHA for ed406b6 - Browse repository at this point
Copy the full SHA ed406b6View commit details -
report failed test count at
TestResult.summary
Checklist: - Invoke tearDown even if the test method fails - Run multiple tests - Report failed tests 👈🏼
Configuration menu - View commit details
-
Copy full SHA for 458eefe - Browse repository at this point
Copy the full SHA 458eefeView commit details -
implement logic to capture exceptions during tests
There's a subtlety hidden in this implementation: if we have any problems during setUp, our test failure will not be correctly reported. A new item was added to the checklist below to cover this case. Checklist: - Invoke tearDown even if the test method fails - Run multiple tests - Report failed tests ✅ - Catch and report setUp errors
Configuration menu - View commit details
-
Copy full SHA for 0d98891 - Browse repository at this point
Copy the full SHA 0d98891View commit details -
add test to make sure
setUp()
errors are caughtChecklist: - Invoke tearDown even if the test method fails - Run multiple tests - Report failed tests ✅ - Catch and report setUp errors 👈🏼 --- Output: ➜ python3 src/test_case_test.py Traceback (most recent call last): File "tdd-xunit-example/src/test_case_test.py", line 39, in <module> TestCaseTestWithBrokenSetup("testFailedSetUp").run() File "tdd-xunit-example/src/test_case.py", line 15, in run self.setUp() File "tdd-xunit-example/src/test_case_test.py", line 11, in setUp raise Exception Exception
Configuration menu - View commit details
-
Copy full SHA for f15c647 - Browse repository at this point
Copy the full SHA f15c647View commit details -
implement exception handling for
setUp()
Checklist: - Invoke tearDown even if the test method fails - Run multiple tests - Report failed tests ✅ - Catch and report setUp errors ✅
Configuration menu - View commit details
-
Copy full SHA for ca7f326 - Browse repository at this point
Copy the full SHA ca7f326View commit details