classification
Title: unittest.TestProgram change breaks nose
Type: behavior Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: michael.foord Nosy List: jpellerin, michael.foord, tarek
Priority: normal Keywords: patch

Created on 2009-07-04 20:27 by jpellerin, last changed 2009-07-14 17:58 by michael.foord. This issue is now closed.

Files
File name Uploaded Description Edit
6418.patch jpellerin, 2009-07-05 01:27 Patch to restore 2.5-style initialization in TestProgram
Messages (5)
msg90123 - (view) Author: Jason Pellerin (jpellerin) Date: 2009-07-04 20:27
This changeset:

http://hg.python.org/cpython/rev/c3fb79d1c036

breaks nose, as it changes the behavior of unittest.TestProgram in a
non-backwards-compatible way. Previously, when called like:

TestProgram(testRunner=None)

self.testRunner would be None when runTests() was called. Now, it is 
populated with the default TextTestRunner class in TestProgram.__init__. 
nose expects self.testRunner to be None or a runner instance in 
runTests(), and thus fails immediately with 2.6.3.

If initialization of self.testRunner could be deferred to runTests() as 
in unitttest for 2.5 and earlier, that would be ideal for nose.
msg90124 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2009-07-04 20:35
This change was made to fix a regression in 2.6.
In 2.5 the default was None and someone (else) made the also backwards
incompatible change to make the default the TextTestRunner class. This
broke test suites (like setuptools for example) which expected to be
able to pass None in and get sensible default behaviour.

The change can't be reverted as it was a bugfix, but a different change
could be applied.
msg90493 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2009-07-13 16:34
Committed in revision 6418. Still needs fixing in trunk (note the patch
itself can't be applied as it is missing a couple of 'self's).

Having problems testing this fix without causing spurious output on stderr.
msg90494 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2009-07-13 16:37
Oops - I meant revision 73997 of course.
msg90515 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2009-07-14 17:58
Committed to trunk in revision 74007.
History
Date User Action Args
2009-07-14 17:58:59michael.foordsetstatus: open -> closed
assignee: michael.foord
resolution: accepted
messages: + msg90515
2009-07-13 16:37:39michael.foordsetmessages: + msg90494
2009-07-13 16:34:14michael.foordsetmessages: + msg90493
2009-07-05 15:17:31tareksetnosy: + tarek
2009-07-05 01:27:03jpellerinsetfiles: + 6418.patch
keywords: + patch
2009-07-04 20:35:46michael.foordsetnosy: + michael.foord
messages: + msg90124
2009-07-04 20:27:27jpellerincreate