Chapter 23. How Suite It Is

Invoke test methodInvoke setUp firstInvoke tearDown afterwardInvoke tearDown even if the test method failsRun multiple testsReport collected resultsLog string in WasRunReport failed testsCatch and report setUp errors

We can't leave xUnit without visiting TestSuite. The end of our file, where we invoke all of the tests, is looking pretty ratty:

					print TestCaseTest("testTemplateMethod").run().summary()
					print TestCaseTest("testResult").run().summary()
					print TestCaseTest("testFailedResultFormatting").run().summary()
					print TestCaseTest("testFailedResult").run().summary()
				

Duplication is always a bad thing, unless you look at it as motivation to find the missing design element. Here we would like the ability ...

Get Test Driven Development: By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.