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.
Created on 2012年04月08日 23:16 by r.david.murray, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| dont_require_test_main.patch | r.david.murray, 2012年04月08日 23:16 | review | ||
| Messages (4) | |||
|---|---|---|---|
| msg157816 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年04月08日 23:16 | |
The attached patch makes 'test_main' optional for stdlib tests. If a test module does not have a 'test_main', regrtest will use the unittest loadTestsFromModule loader to load the tests. This moves us further in the direction of using normal unittest facilities instead of specialized regrtest ones. Any test module that can be correctly run currently using python unittest -m test.test_xxx could be converted to use this by simply deleting its test_main, thus no longer requiring manual maintenance of the list of tests to run. Not all tests can be converted that easily, however, since test_main sometimes does some additional things (such as reap_children or reap_threads). |
|||
| msg157823 - (view) | Author: Michael Foord (michael.foord) * (Python committer) | Date: 2012年04月08日 23:39 | |
Looks good to me. Note that if module level setup and teardown is needed for running tests then it should be possible to do this with setUpModule and tearDownModule functions (unless those should *only* be done when running under regrtest). |
|||
| msg157829 - (view) | Author: R. David Murray (r.david.murray) * (Python committer) | Date: 2012年04月09日 01:52 | |
I can't imagine when you'd *not* want setUpModule/tearDownModule to run, so that's a reasonable conversion path. The other path for reap_children and reap_threads would be to apply them to the individual classes that require them within the test module. Which you do depends on how many test classes need the cleanups, I think. I'm sure there will be other subtleties to be solved for other modules. Note that I'm not advocating anyone go through and wholesale convert test modules. But I think any time someone would otherwise have to update the list of tests in test_main, converting that test to eliminate test_main should be considered. |
|||
| msg157843 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年04月09日 13:13 | |
New changeset eff551437abd by R David Murray in branch 'default': #14533: if a test has no test_main, use loadTestsFromModule. http://hg.python.org/cpython/rev/eff551437abd |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:28 | admin | set | github: 58738 |
| 2012年04月09日 13:14:12 | r.david.murray | set | status: open -> closed resolution: fixed stage: resolved |
| 2012年04月09日 13:13:13 | python-dev | set | nosy:
+ python-dev messages: + msg157843 |
| 2012年04月09日 01:52:01 | r.david.murray | set | messages: + msg157829 |
| 2012年04月08日 23:39:01 | michael.foord | set | messages: + msg157823 |
| 2012年04月08日 23:16:47 | r.david.murray | create | |