New submission from Erik Andersén:

When a unittest test case raises an Exception, that test case is
considered a failure. However, raising NotImplementedError is not a
failure. It is something completely normal during development and 
simply indicates that the functionality has not yet been implemented.
Compare this to a test case that genuinely fails, which means that the
implementation does something different from what is is supposed to do.

I therefore think test cases raising NotImplementedError should not be
treated as failures, but be reported separately as what they are --
parts of the program that have not yet been implemented. Reporting such 
test cases as failures will give a lot of failure warnings that may 
detract attention from those cases that are genuinely errors. Also, 
SimpleTextRunner will report a lot of useless stack traces for these 
cases, thereby makeing it harder to find the stack traces for those
tests that realy failed.

I have made a patch to unittest that reports such cases as "not 
implemented" rather than as failures. This includes changes to the 
documentation and unit test case for unittest and doctest. 
I have included 
"added/changed in version 2.6" remarks in the documentation, so
you have to changed these if the patch gets into some other version.

Patch against 59056 attached

----------
components: Library (Lib)
files: unittest.diff
messages: 57648
nosy: erik_andersen
severity: normal
status: open
title: Special reporting of NotImplementedError in unittest
type: rfe
Added file: http://bugs.python.org/file8780/unittest.diff

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1466>
__________________________________

Attachment: unittest.diff
Description: Binary data

_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to