[wingide-users] WingIDE and Zope unit tests: Solution!
Wing IDE Support
support at wingware.com
Fri Feb 4 13:05:13 EST 2005
On Fri, 4 Feb 2005, Lennart Regebro wrote:
> Quite, correct, and after that it did run properly through zopectl.py,
> but the debugger didn't break at any breakpoints. I realized I was
> thinking about the whole thing completely backwards, of course. I'm
> trying to run Zopes test scripts. They do a couple of things:
> 1. Set up the correct environment like Python path and so.
> 2. Special Product magick fiddling.
> 3. Find loads of different test files and run then.
> Of course, I have no particular need to run all the unit tests from
> within WingIDE. It's first when I have a test that fails that I need to
> do that, and then I should not need to run test.py, I should be able to
> just run the unit test separately. But that's a bit tricky with Zope,
> because Zope has two Product directories, so if you add them both to the
> Python path it will only find the products in one of then.
It might help to check on "Zope support" in the Project
Properties dialog and enter the zope instance home directory
Yes, Zope2 is a pain to deal with because of the path magic
> One minor annoyance: WingIDE will break when the unit tests call
> sys.exit(), even if the tests were successful.
> The code is in unittest.py, line 759:
> sys.exit(not result.wasSuccessful())
> So, on a successful run, it will call sys.exit(False). Ignoring that
> exception position makes no difference. But that's a minor annoyance,
> and nothing serious.
Yes, we plan to fix this to allow ignoring of whole classes of
exceptions, with the default being to ignore sys.exit(0).
Glad it's working! Thanks for using Wing.
Wing IDE for Python
Advancing Software Development
More information about the wingide-users