classification
Title: Wish: disable tests in unittest
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, jmp, michael.foord
Priority: low Keywords: patch

Created on 2008-06-25 19:53 by jmp, last changed 2009-04-25 23:59 by benjamin.peterson. This issue is now closed.

Files
File name Uploaded Description Edit
unittest-disable.patch jmp, 2008-06-25 19:53 patch
sample_tests.py jmp, 2008-06-25 19:53
Messages (4)
msg68752 - (view) Author: Justin Mazzola Paluska (jmp) Date: 2008-06-25 19:53
The attached patch (unittest-disable.patch) allows methods in
unittest.TestCases to be "disabled".  The patch is against
Python2.5 from Debian:

%python2.5
Python 2.5.2 (r252:60911, Apr 17 2008, 13:15:05) 
[GCC 4.2.3 (Debian 4.2.3-3)] on linux2

Disabled tests are not run, but are "remembered" in the output of the
test program.  For example, the attached sample_tests.py has two
tests, one of which has been disabled.  The output is:

%python sample_tests.py 
.D
----------------------------------------------------------------------
Ran 2 tests in 0.000s

OK

where the D indicates that a test has been disabled.

Disabling tests is useful if you're using a "test first" coding
workflow, as some tests may test functionality that hasn't been
implemented yet.  The failures of these tests (with their noisy
tracebacks) makes it harder to concentrate on other, real failures
that may be occurring in your tests.
msg68753 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-06-25 20:01
If you could convince Python-dev for something like this, I'd gladly
implement it. In fact, I'm working implementing this for the Python test
suite (It's called skipping).
msg86573 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2009-04-25 23:44
Is this made obsolete by test skipping?
msg86575 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-04-25 23:59
Yes.
History
Date User Action Args
2009-04-25 23:59:57benjamin.petersonsetstatus: open -> closed
resolution: out of date
messages: + msg86575
2009-04-25 23:44:12michael.foordsetnosy: + michael.foord
messages: + msg86573
2008-06-25 20:01:48benjamin.petersonsetpriority: low
nosy: + benjamin.peterson
messages: + msg68753
versions: + Python 2.7, - Python 2.5
2008-06-25 19:53:46jmpsettype: enhancement
2008-06-25 19:53:40jmpsetfiles: + sample_tests.py
2008-06-25 19:53:27jmpcreate