[issue1034053] unittest.py patch: add skipped test functionality
Benjamin Peterson
report at bugs.python.org
Mon Dec 29 18:39:33 CET 2008
Benjamin Peterson <benjamin at python.org> added the comment:
I think this is a good improvement, and I hope it can make it into 2.7/3.1.
Several comments on patch:
- I don't like the name "SkipException" SkipTest is better IMO.
- TestResult.addSkipped should be changed to TestResult.addSkip.
- I'm not sure why TestResult.addSkipped gets sys.exc_info() pass in. I
think you should just catch the exception and pass the reason ("str(e)")
to addSkipped.
- The patch needs docs before it can be applied.
- As Antoine said, it would be nice to have decorators for skipping.
When I implemented this, I added the skip() (unconditional skip)
skip_if(condition, reason) and skip_unless(condition, reason)
decorators. It should also be easy to extend the mechanism, so that
custom decorators can be written.
- It would nice to be able to skip whole classes, too. This could easily
be done with class decorators.
(Georg, I hope you don't mind if I "steal" this from you.)
----------
assignee: georg.brandl -> benjamin.peterson
nosy: +benjamin.peterson
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1034053>
_______________________________________
More information about the Python-bugs-list
mailing list