November 2002
Intermediate to advanced
240 pages
5h 9m
English
We’ll write a smaller grained test to ensure that if we note a failed test, we print out the right results:
TestCaseTest
def testFailedResultFormatting(self):
result= TestResult()
result.testStarted()
result.testFailed()
assert("1 run, 1 failed" == result.summary())
“testStarted()” and “testFailed()” are the messages we expect to send to the result when a test starts and when a test fails, respectively. If we can get the summary to print correctly when these messages are sent in this order, ...