From: Alan K. <jyt...@xh...> - 2007-07-31 22:33:38
|
[Charlie] > test_select_new > is not really a unittest at all. It just uses the fact that > unittest runs the methods in alphabetical order to run the numerical > tests one after another. They're all dependent. > > I'd like to switch it to an actual unittest with separate test cases > and a setUp and tearDown for each, but I'm not sure if Alan made it > the way it is for a reason. Alan? What I wanted with that set of tests was to test all possible states of readability, writability and acceptability. I originally thought of doing a simple state machine based test, with a set of states that a series of threads would move through, in a coordinated fashion. However, that would not have worked with unittest, and thus would have been difficult to integrate into automated test harnesses. So I decided to use a little trick I've seen successfully used before, whereby a series of tests that depend on previous tests are numbered, which causes them to be run in sequence. There is no reason why could not be refactored to run completely standalone, as unit-tests ideally should. Regards, Alan. |