#NEWLINE# def process_tests( suite , process ) : #NEWLINE# #INDENT# "Find and process the suite with setup/teardown methods.\n\n    Given a nested disaster of [Lazy]Suites, traverse to the first level\n    that has setup or teardown, and do something to them.\n\n    If we were to traverse all the way to the leaves (the Tests)\n    indiscriminately and return them, when the runner later calls them, they'd\n    run without reference to the suite that contained them, so they'd miss\n    their class-, module-, and package-wide setup and teardown routines.\n\n    The nested suites form basically a double-linked tree, and suites will call\n    up to their containing suites to run their setups and teardowns, but it\n    would be hubris to assume that something you saw fit to setup or teardown\n    at the module level is less costly to repeat than DB fixtures. Also, those\n    sorts of setups and teardowns are extremely rare in our code. Thus, we\n    limit the granularity of bucketing to the first level that has setups or\n    teardowns.\n\n    :arg process: The thing to call once we get to a leaf or a test with setup\n        or teardown\n    " #NEWLINE# if ( ( not hasattr ( suite , '_tests' ) ) or ( hasattr ( suite , 'hasFixtures' ) and suite . hasFixtures ( ) ) ) : #NEWLINE# #INDENT# process ( suite ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for t in suite . _tests : #NEWLINE# #INDENT# process_tests ( t , process )