anacrolix at gmail
Apr 9, 2012, 12:11 PM
Post #2 of 4
On Apr 10, 2012 2:36 AM, "Terry Reedy" <tjreedy [at] udel> wrote:
Re: [Python-checkins] cpython: #14533: if a test has no test_main, use loadTestsFromModule.
[In reply to]
> On 4/9/2012 9:13 AM, r.david.murray wrote:
>> changeset: 76176:eff551437abd
>> user: R David Murray<rdmurray [at] bitdance>
>> date: Mon Apr 09 08:55:42 2012 -0400
>> #14533: if a test has no test_main, use loadTestsFromModule.
>> This moves us further in the direction of using normal unittest
>> instead of specialized regrtest ones. Any test module that can be
>> run currently using 'python unittest -m test.test_xxx' can now be
>> use normal unittest test loading by simply deleting its test_main, thus
>> longer requiring manual maintenance of the list of tests to run.
>> + if __name__ == '__main__':
>> + unittest.main()
>> - if __name__ == '__main__':
>> - test_main()
> Being on Windows, I sometimes run single tests interactively with
> from test import test_xxx as t; t.test_main()
> Should t.unittest.main(t.__name__) work as well?
> Should this always work even if there is still a test_main?
Both questions have the same answer. Yes, because this is how discovery
> Python-Dev mailing list
> Python-Dev [at] python