[Python-Dev] [Python-checkins] cpython: #14533: if a test has no test_main, use loadTestsFromModule.

Terry Reedy tjreedy at udel.edu
Tue Apr 10 01:38:36 CEST 2012


On 4/9/2012 3:57 PM, R. David Murray wrote:
> On Mon, 09 Apr 2012 13:34:25 -0400, Terry Reedy<tjreedy at udel.edu>  wrote:

>> Should t.unittest.main(t.__name__) work as well?
>
> That will work.
>
> t.unittest.main(t) will also work and is less typing.

Good. The only doc for the parameter is "unittest.main(module='__main__',"
with no indication other than the name 'module' that both a module 
object or a name is accepted (as with some file object or name interfaces).

>> Should this always work even if there is still a test_main?
>
> It will work if and only if the test can be run correctly via './python
> -m unittest test.test_xxx'.  Not all test files in Lib/test can be run that
> way (though I at least am open to fixing ones that don't work).

One way to again run each would be nice. I will open an issue if I find 
any laggards.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list