:\pp \system\testertype outputs\test-basic-stdout out bad begin spamspam!spamspam!spam!spamspam!spam!spam!spamend one last usage noteif you change the trace variable in this script to be verboseyou'll get much more output designed to help you trace the programs operation (but probably too much for real testing runs) :\pp \system\testertester py start testermon feb : : in :\users\mark\stuff\books\ \pp \dev\examples\pp \system\tester :\users\mark\stuff\books\ \pp \dev\examples\pp \system\tester \scripts\test-basic-args py \scripts\test-basic-stdout py \scripts\test-basic-streams py \scripts\test-basic-this py \scripts\test-errors-runtime py \scripts\test-errors-syntax py \scripts\test-status-bad py \scripts\test-status-good py :\python \python exe \scripts\test-basic-args py -command -line --stuff 'eggs\ \ \ \nb' :\\users\\mark\\stuff\\books\\ \\pp \\dev\\examples\\pp \\system\\tester\ \nc:\\users\\mark\\stuff\\books\\ \\pp \\dev\\examples\\pp \\system\\tester\scripts\ \ [argv]\ \ \\scripts\\test-basic-args py\ \ -command\ \ -line\ \ --st uff\ \ [interaction]\ \nenter text:eggseggseggseggseggseggseggseggseggseggsb' passedtest-basic-args py more lines deleted study the test driver' code for more details naturallythere is much more to the general testing story than we have space for here for examplein-process tests don' need to spawn programs and can generally make do with importing modules and testing them in try exception handler statements there is also ample room for expansion and customization in our testing script (see its docstring for startersmoreoverpython comes with two testing frameworksdoctest and unittest ( pyunit)which provide techniques and structures for coding regression and unit testsunittest an object-oriented framework that specifies test casesexpected resultsand test suites subclasses provide test methods and use inherited assertion calls to specify expected results regression test script