[3.13] gh-137242: Add a --no-randomize option, and use it in Android … · python/cpython@6f17532 · GitHub
Skip to content

Commit 6f17532

Browse files
vstinnermhsmith
authored andcommitted
[3.13] gh-137242: Add a --no-randomize option, and use it in Android CI (GH-138649)
Adds a --no-randomize option to the CI runner, so that randomisation can be easily disabled for --fast-ci and --slow-ci configurations on single-threaded testing platforms like Android, iOS, and Emscripten. --------- (cherry picked from commit 01895d2) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Malcolm Smith <smith@chaquo.com>
1 parent 9a6137a commit 6f17532

3 files changed

Lines changed: 40 additions & 7 deletions

File tree

Android/android.py

Lines changed: 3 additions & 5 deletions

Lib/test/libregrtest/cmdline.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ def _create_parser():
259259
group = parser.add_argument_group('Selecting tests')
260260
group.add_argument('-r', '--randomize', action='store_true',
261261
help='randomize test execution order.' + more_details)
262+
group.add_argument('--no-randomize', dest='no_randomize', action='store_true',
263+
help='do not randomize test execution order, even if '
264+
'it would be implied by another option')
262265
group.add_argument('-f', '--fromfile', metavar='FILE',
263266
help='read names of tests to run from a file.' +
264267
more_details)
@@ -512,6 +515,8 @@ def _parse_args(args, **kwargs):
512515
ns.use_resources.append(r)
513516
if ns.random_seed is not None:
514517
ns.randomize = True
518+
if ns.no_randomize:
519+
ns.randomize = False
515520
if ns.verbose:
516521
ns.header = True
517522

Lib/test/test_regrtest.py

Lines changed: 32 additions & 2 deletions

0 commit comments

Comments
 (0)