Issue 37873: unittest: execute tests in parallel
Created on 2019-08-16 14:15 by user93448, last changed 2022-04-11 14:59 by admin.
| Messages (5) | |||
|---|---|---|---|
| msg349864 - (view) | Author: D. A. Pellegrino (user93448) | Date: 2019-08-16 14:15 | |
The unittest documentation makes reference to a potential parallelization feature: "Note that shared fixtures do not play well with [potential] features like test parallelization and they break test isolation. They should be used with care." (https://docs.python.org/3/library/unittest.html) However, it seems that executing tests in parallel is not yet a feature of unittest. This enhancement request is to add parallel execution of tests to unittest. A command line option may be a good interface. Ideally, it would be compatible with test discovery. Outside of the Python ecosystem, a common practice is to define test cases in a Makefile and then execute GNU Make with the '-j' flag (https://www.gnu.org/software/make/manual/html_node/Parallel.html#Parallel). Adding such an option to unittest would be a convenience and may save the effort of bringing in additional libraries or tools for parallel unit test execution. |
|||
| msg349938 - (view) | Author: Terry J. Reedy (terry.reedy) * ![]() |
Date: 2019-08-19 06:03 | |
test.regrtest has a -j option. Perhaps some of the Python coding for that could be used for unitest also. |
|||
| msg350080 - (view) | Author: Karthikeyan Singaravelan (xtreak) * ![]() |
Date: 2019-08-21 12:55 | |
See also https://mail.python.org/pipermail/python-ideas/2017-September/047100.html . One of the ideas in the thread was to move test.regrtest parallel execution functionality into unittest. I think this would be good to have it in unittest like support in pytest for -j. |
|||
| msg375126 - (view) | Author: D. A. Pellegrino (user93448) | Date: 2020-08-10 15:55 | |
Leveraging GNU Parallel (https://www.gnu.org/software/parallel/) might help simplify implementation. Perhaps that could be used as a subprocess call? |
|||
| msg375128 - (view) | Author: STINNER Victor (vstinner) * ![]() |
Date: 2020-08-10 16:10 | |
> Leveraging GNU Parallel (https://www.gnu.org/software/parallel/) might help simplify implementation. Perhaps that could be used as a subprocess call? In general, we attempt to avoid depending on the availability of external tool. For example, I don't expect this tool to be available on Windows, whereas it would be better to support parallel execution on Windows as well. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:19 | admin | set | github: 82054 |
| 2020-09-02 09:57:36 | vstinner | set | nosy:
- vstinner |
| 2020-09-01 19:50:21 | bar.harel | set | nosy:
+ bar.harel |
| 2020-08-10 16:10:33 | vstinner | set | messages: + msg375128 |
| 2020-08-10 15:55:46 | user93448 | set | messages: + msg375126 |
| 2020-04-30 20:06:10 | giampaolo.rodola | set | nosy:
+ giampaolo.rodola |
| 2019-08-21 12:55:16 | xtreak | set | messages: + msg350080 |
| 2019-08-21 12:45:09 | xtreak | set | nosy:
+ xtreak |
| 2019-08-21 10:55:14 | vstinner | set | nosy:
+ vstinner |
| 2019-08-19 06:03:56 | terry.reedy | set | nosy:
+ ezio.melotti, michael.foord |
| 2019-08-19 06:03:39 | terry.reedy | set | nosy:
+ terry.reedy messages: + msg349938 |
| 2019-08-16 14:15:27 | user93448 | create | |
