Re: [Pyunit-interest] JPython compat
Brought to you by:
purcell
From: Steve P. <ste...@ya...> - 2000-06-20 23:13:00
|
Rob Giardina wrote: > Does anyone have a pointer on the incompatibility with JPython? The doc > expressly says it's not compatible... Hi Rob, I didn't make any great effort to make PyUnit run identically in CPython and JPython for a few reasons. Firstly, there's already JUnit, and its TestCase class can be directly subclassed in JPython. Why reinvent the wheel, I thought? Secondly, any future GUI test runner for PyUnit would not work with JPython, since it would most probably use Tkinter. And since JPython subclasses of PyUnit's TestCase class don't work with JUnit, PyUnit would end up needing its own JPython clone of JUnit's GUI. Doesn't sound like the Simplest Thing That Could Possibly Work. Thirdly, I've found JPython disappointing, and most efforts to make non-trivial code work identically in CPython and JPython end up in a big mess. Although I use JPython quite a lot, I restrict its use to those situations in which I know it works, and I use the old JPython rather than the new one because it feels more solid. Technically, the reason for the current incompatibility is that for readability of error printouts, I tweak the traceback object a little. JPython's traceback objects are different to those of CPython, so that code will not work with JPython. Now... I hear that with a few changes in 'unittest.py', PyUnit in its current incarnation *does* work with JPython. So, if text output only is okay, I would be happy to share the secret incantations! I'd love to hear about how well (or not) subclassing JUnit's UnitTest works with JPython, too. Best wishes, -Steve P. -- Steve Purcell, Technical Director, Inkontact Get in touch at http://www.inkontact.com/ |