Re: [Pyunit-interest] Re: Pyunit-interest digest, Vol 1 #27 - 1 msg
Brought to you by:
purcell
From: Steve P. <ste...@ya...> - 2000-11-21 17:07:14
|
Pieter Nagel wrote: > > Wouldn't it be better if, instead of test inheriting from TestCase > so that you can ask a test: "Hey you! Inspect yourself for test > methods and run yourself!", you just hand the test runner an > arbitrary class and as *it*: "Here's a class. Inspect it for checkXXX > methods and run them". Isn't that what the 'makeSuite' function does? The TestCase classes often include a number of different test methods, but each instance, once created, is responsible for running only *one* of those methods; hence the parameter. This is the (perhaps less-than-obvious) distinction made between TestCases and TestSuites. There are probably other ways to arrange matters, but the current way seems to work for most people. From what I've seen, most PyUnit test authors use 'makeSuite' to construct suites from TestCase subclasses in which they have inserted multiple 'checkXXX' methods. Your suggestion amounts to putting the 'makeSuite' function inside a TestCase, which amounts to changing a TestCase into a TestSuite. > - The SUnit which Kent's group use internally is by now nothing > like the original one they published, and Presumably the latest version of JUnit is representative of any changes they've made. PyUnit is pretty much up to date with JUnit as far as I can tell, so I don't think we're lagging too much. > - The XUnit community might have got themselves stuck on the > "simplest thing that could possibly work", minus the benefit of > later refactorings, on the false assumption that they've been > handed an API that they may not change. This is certainly a danger, but "if it ain't broke, don't fix it" suggests caution so long as the needs of most people are catered for. Thanks for taking the time to comment. Perhaps you'd like to submit a few lines of code to show how you'd like the interface to look? I'd also love to hear specific suggestions from anyone on the list about possible improvements, now that you've all been using the package for a while. Best wishes to all, -Steve -- Steve Purcell, Pythangelist Mobile: +44 7811 826 620 (UK) Mobile: +49 175 694 2537 (DE) "Life must be simple if *I* can do it" -- me |