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.

classification
Title: regrtest: add switch -c to run only modified tests
Type: enhancement Stage:
Components: Tests Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: ezio.melotti, georg.brandl, pitrou, python-dev, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2014-11-06 14:59 by georg.brandl, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
regrtest_changed.diff georg.brandl, 2014-11-06 14:59 review
Messages (7)
msg230748 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2014-11-06 14:59
A quick way to select only tests that are modified in the checkout.
msg230750 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-11-06 15:39
Unfortunately this doesn't work with tests for pickle, json or tkinter.

I'm afraid this feature would make false promise. Without careful check you can not be confident that all modified tests are selected. If you going to add this switch, it should emit a

********************
*                  *
*   LOUD WARNING   *
*                  *
********************

and enumerate all modified files containing 'test' in its path which are not recognized as valid test name.
msg230751 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-11-06 15:58
I agree this is more dangerous than useful.
(even if you haven't modified a test it may still be impacted by some other change)
msg230752 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2014-11-06 16:28
Well, this is not meant as a comprehensive "run ALL impacted tests" because that is impossible in general :)

An alternate suggestion would be to allow filenames like "Lib/test/test_foo.py" as arguments to regrtest. Then I could run without the switch using

.../regrtest.py `hg status -amn`
msg252161 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-10-02 21:15
I'm now closing this issue because Antoine, Serhiy and me dislike the idea.

> An alternate suggestion would be to allow filenames like "Lib/test/test_foo.py" as arguments to regrtest.

This sounds like a better plan. Please open a new issue if you still need that.

FYI I refactoring regrtest.py into libregrtest, it might be easier to enhance it now.
msg252170 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-10-02 22:47
New changeset 1005573e6a74 by Victor Stinner in branch 'default':
Issue #22806: Add ``python -m test --list-tests`` command to list tests.
https://hg.python.org/cpython/rev/1005573e6a74
msg252171 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-10-02 22:48
I added "python -m test --list-tests". It's not perfect but it's better than nothing :-p
History
Date User Action Args
2022-04-11 14:58:09adminsetgithub: 66995
2015-10-02 22:48:59vstinnersetmessages: + msg252171
2015-10-02 22:47:44python-devsetnosy: + python-dev
messages: + msg252170
2015-10-02 21:15:51vstinnersetstatus: open -> closed

nosy: + vstinner
messages: + msg252161

resolution: wont fix
2015-07-21 07:44:04ethan.furmansetnosy: - ethan.furman
2014-11-07 17:20:27ethan.furmansetnosy: + ethan.furman
2014-11-06 17:26:05ezio.melottisetnosy: + ezio.melotti
2014-11-06 16:28:51georg.brandlsetmessages: + msg230752
2014-11-06 15:58:54pitrousetmessages: + msg230751
2014-11-06 15:39:59serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg230750
2014-11-06 14:59:16georg.brandlcreate