[TIP] 2.6.3 unittest change breaks nose
fuzzyman at voidspace.org.uk
Sat Jul 4 18:10:09 PDT 2009
On 4 Jul 2009, at 22:42, jason pellerin <jpellerin at gmail.com> wrote:
>> Why not just pass in your custom test runner?
> nose's TestRunner needs more arguments than the default class. And
> setting the default testRunner class in the arguments to __init__
> wasn't the pattern in previous unittests. nose is old! :)
But you can also pass in an instance right?
>> Monkey-patching TestProgram.runTests seems like a really bad idea...
> I'm not being clear, I guess.. nose doesn't monkeypatch anything. It
> overrides runTests() in the normal OO sense. nose has None as the
> default for testRunner since that was the default in TestProgram for
> all versions of unittest up until 2.6. It has the same check in
> runTests() as those versions of unittest -- if self.testRunner is
> None, set it to the default. (And then do a bunch of stuff with
> plugins, etc). That works fine for everything from 2.3 to 2.6.2, but
> the change in 2.6.3 sneaks an assignment to self.testRunner in between
> nose's setting the default to None and where nose expects to see the
> default, which is a new behavior for unittest.
TestProgram is so fundamentally broken (and mercifully short) that you
would save yourself much trouble by re-implementing the bits you need
rather than re-using it.
>> It's missing a patch... :-)
> Heh. Yes, I guess it is. I'll add one in the next few days if nobody
> beats me to it.
Cool - I'll be AFK for a week I'm afraid.
More information about the testing-in-python