Chapter 23

How Suite It Is

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 ...

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.