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.

Author xdegaye
Recipients georg.brandl, michael.foord, r.david.murray, terry.reedy, vstinner, xdegaye
Date 2014-10-21.10:27:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1413887245.89.0.837477600753.issue22607@psf.upfronthosting.co.za>
In-reply-to
Content
The attached patch adds the '-X' and '-Y' options to the regrtest tool, allowing to select a range of tests and a range of their subtests.  The patch is missing the test cases for the moment.

Limitation:
Does not work very well with nested subtest (nested subtests are currently only used by the unittest test suite itself): subtest numbers are flattened across all the nested subtests.

Here is the sequence of commands that would have allowed to find the subtest responsible for the crash in test_capi at issue 22588, without modifying any code:
./python -m test -X "[]" test_capi                  # Get the test count: 18 tests.
./python -m test -X "range(1,10)" -R 23:23 test_capi            # pass
./python -m test -X "range(10,15)" -R 23:23 test_capi           # pass
./python -m test -X "range(15,17)" -R 23:23 test_capi           # pass
./python -m test -X "[17]" -R 23:23 test_capi                   # pass
./python -m test -X "[18]" -R 23:23 test_capi                   # fail
./python -m test -X "[18]" -Y "[]" test_capi        # Test 18 has 35 subtests.
./python -m test -X "[18]" -Y "range(1,19)" -R 23:23 test_capi  # fail
./python -m test -X "[18]" -Y "range(1,10)" -R 23:23 test_capi  # fail
./python -m test -X "[18]" -Y "range(1,6)" -R 23:23 test_capi   # pass
./python -m test -X "[18]" -Y "range(6,8)" -R 23:23 test_capi   # pass
./python -m test -X "[18]" -Y "[8]" -R 23:23 test_capi          # pass
./python -m test -X "[18]" -Y "[9]" -R 23:23 test_capi          # fail

Output of the last command:
Test# 18: test__testcapi
subTest# 9: internal, {'name': 'test_incref_decref_API'}
History
Date User Action Args
2014-10-21 10:27:26xdegayesetrecipients: + xdegaye, georg.brandl, terry.reedy, vstinner, r.david.murray, michael.foord
2014-10-21 10:27:25xdegayesetmessageid: <1413887245.89.0.837477600753.issue22607@psf.upfronthosting.co.za>
2014-10-21 10:27:25xdegayelinkissue22607 messages
2014-10-21 10:27:25xdegayecreate