Re: [Pyunit-interest] Modifications to PyUnit
Brought to you by:
purcell
From: Stephen P. <ste...@ya...> - 2000-06-04 04:37:54
|
Nathan Heagy wrote: > > I've made some modifications to PyUnit on my own. I made them so I can > use PyUnit the way I use other Unit Tests frameworks based on JUnit. I > don't think they are production quality (for anyone but me, that is) so > if I could get some feedback I am interested in making changes so that I > can formally submit them to PyUnit. Hi Nathan, The GUI looks cool; thanks for sending it in. I have a few comments overall, which may or may not help you: 1.) The ability to create a TestSuite instance from a TestCase class containing conventionally named methods is actually already provided by the outboard function 'unittest.makeSuite()'. I think I prefer this to altering the TestSuite constructor. 2.) Take a look at 'unittest.createTestInstance()'. This function takes a fully qualified string name for a callable object that returns a TestCase or TestSuite instance. I've used it for the command-line operation of the unittest module itself with TextTestRunner, and with the fledgling Tkinter GUI I started months ago. It would probably suit your needs too. Then you don't need to implicitly create TestSuites to wrap the test names entered by the user. I'll try to send back an appropriate patch if time allows. (Doing an 'import *' from within the test runner is probably a bit dangerous in terms of namespace pollution) 3.) There are complications with reloading modules -- see the recent discussions on the list between Shae and myself. To reload the test module is not enough to ensure that the tested module is reloaded too. Best wishes, and thanks again! -Steve _____________________________________________ Steve Purcell, Technical Director, Inkontact Get in touch at http://www.inkontact.com/ |