From: Russell S. <ras...@mn...> - 2001-07-13 19:47:38
|
Hi, I am evaluating PyUnit for a testing framework I need at work. I'm running into one small problem. One of our requirements is to execute each test once for each file in a rather large set of input files. Ideally, I need a mechanism to iterate over the files in the file set, and execute each test suite once (and subsequently, each test case within the suite) once for the given file. I don't see any real hooks to pass arguments to the test suite or test case. My initial hopes were dashed when I found that both TestSuite.Run() and TextTestRunner.Run() both directly call the test rather than calling a an overridable method to do so. That would have given me a perfect hook to push one or more values into the target before executing it. Can I do this via some trickery with a customized TestLoader? How have others approached this problem? I hope the answer is not to code a unique test case for each combination of test case and input file - the size (as well as the subsequent effort to maintain and extend) would be overwhelming. Thanks in advance. Russ |