The following forum message was posted by at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/4543888:
I've recently started using unittest2 to test my Python 2.6 project, because
I want the new testing features from Python 2.7's unittest (unittest2 is a backport).
However, it appears that Pydev's test runner ignores my "if __name__ == '__main__':
unittest2.main()" block, and runs the regular unittest.main() function instead.
This ends up breaking a bunch of the unittest2 functionality, and I'd really
like to know how to get around that.
I can make the code work by running the module as a regular "Python run" instead
of "Python unit-test", but I can't do that for more than one module at a time
(as far as I know). Since my code shop's standard pre-deploy testing procedure
is to right-click the project in the package explorer and choose "Run As > Python
unit-test", I need my code to work properly when batch executed like that.
The following forum message was posted by fabioz at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/4543888:
The only proper way is PyDev supporting what you want.
What features are breaking? Can you check the latest nightly to see if it works
for you? (I remember making some fixes related to that, just not sure what's
your actual use case).
Get latest updates about Open Source Projects, Conferences and News.