[New-bugs-announce] [issue1466] Special reporting of NotImplementedError in unittest

Erik Andersén report at bugs.python.org
Mon Nov 19 19:32:56 CET 2007

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 <report at bugs.python.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unittest.diff
Type: application/octet-stream
Size: 14884 bytes
Desc: not available
Url : http://mail.python.org/pipermail/new-bugs-announce/attachments/20071119/de680a8e/attachment-0001.obj 

More information about the New-bugs-announce mailing list