This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jimjjewett
Recipients
Date 2006-09-01.21:08:14
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=764593

>> The type checking in TestLoader is only 
>> there to *find* the tests. ... doesn't
>> mean the limitations should be forced
>> down to TestSuite.

> The important thing is that unittest 
> presents a unified view of what is and
> what is not a test case.

Why?  If you were designing from scratch, I would agree, 
because it would make understanding the module easier.  But 
once the module has been deployed this long -- particularly 
with the various confusing aspects -- people have gotten 
used to treating it as a black box.  If they go through the 
full procedure, then it won't matter that the runner could 
have handled something else too.  If they go around the 
loader, then this change will break their regression 
testing.  At a minimum, it needs to be something that can 
be shut off again easily (such as a strict option), but in 
that case ... why bother to enforce it at all?

>> ... docs ... for the last _five years_ 
>> -- I'd say this is a long-standing bug
>> in the code, not the documentation.

The disagreement between them is a long-standing bug.  But 
this can be resolved by changing either.  A feature is a 
bug with seniority.  After this long, even a bad decision 
needs to be respected for backwards compatibility.  (It 
could certainly be changed for Py3K, though.)

> Your position seems to be "the code
> works as written; who cares what the
> intention was".

Close.  The code is _in_use_ as written, and is in use by 
people who don't fully understand the intent.  Honoring the 
developers' original intent would break things for users.

> ... core idea behind the TestLoader
> methods is to return something that can be run()";
> ... the addition of __iter__ to TestSuite
> ... ``list(loader.loadTestsFromName("foo.bar"))''
> raised unexpected TypeErrors, complaining that 
> the return value from loadTestsFromName() wasn't 
> iterable.

So the change to TestSuite wasn't as compatible as 
expected, nor as tested and documented as desired.  :{

The docs should definately be changed to mention this 
requirement, and the code should probably be changed to 
make your code work.  That could mean adding iteration to 
TestCase, or it could mean fixing loadTests... to wrap 
individual cases in a suite, or, for safety, it could mean 
both.

				
History
Date User Action Args
2007-08-23 15:54:29adminlinkissue1550273 messages
2007-08-23 15:54:29admincreate