def _filter_suite(suite, pred):
newtests = []<EOL>for test in suite._tests:<EOL><INDENT>if isinstance(test, unittest.TestSuite):<EOL><INDENT>_filter_suite(test, pred)<EOL>newtests.append(test)<EOL><DEDENT>else:<EOL><INDENT>if pred(test):<EOL><INDENT>newtests.append(test)<EOL><DEDENT><DEDENT><DEDENT>suite._tests = newtests<EOL>
Recursively filter test cases in a suite based on a predicate.