@@ -155,7 +155,7 @@ def __init__(self, **kwargs) -> None:
155
155
self .list_cases = False
156
156
self .list_tests = False
157
157
self .single = False
158
- self .randomize = None
158
+ self .randomize = False
159
159
self .fromfile = None
160
160
self .fail_env_changed = False
161
161
self .use_resources : list [str ] = []
@@ -271,7 +271,7 @@ def _create_parser():
271
271
group = parser .add_argument_group ('Selecting tests' )
272
272
group .add_argument ('-r' , '--randomize' , action = 'store_true' ,
273
273
help = 'randomize test execution order.' + more_details )
274
- group .add_argument ('--no-randomize' , dest = 'randomize ' , action = 'store_false ' ,
274
+ group .add_argument ('--no-randomize' , dest = 'no_randomize ' , action = 'store_true ' ,
275
275
help = 'do not randomize test execution order, even if '
276
276
'it would be implied by another option' )
277
277
group .add_argument ('--prioritize' , metavar = 'TEST1,TEST2,...' ,
@@ -459,8 +459,7 @@ def _parse_args(args, **kwargs):
459
459
# -j0 --randomize --fail-env-changed --rerun --slowest --verbose3
460
460
if ns .use_mp is None :
461
461
ns .use_mp = 0
462
- if ns .randomize is None :
463
- ns .randomize = True
462
+ ns .randomize = True
464
463
ns .fail_env_changed = True
465
464
if ns .python is None :
466
465
ns .rerun = True
@@ -541,8 +540,10 @@ def _parse_args(args, **kwargs):
541
540
ns .use_resources .remove (r )
542
541
elif r not in ns .use_resources :
543
542
ns .use_resources .append (r )
544
- if ns .random_seed is not None and ns . randomize is None :
543
+ if ns .random_seed is not None :
545
544
ns .randomize = True
545
+ if ns .no_randomize :
546
+ ns .randomize = False
546
547
if ns .verbose :
547
548
ns .header = True
548
549
0 commit comments