63
63
from dataclasses import dataclass , field
64
64
from functools import lru_cache
65
65
from pathlib import Path
66
+ from textwrap import dedent
66
67
67
68
DIR = Path (__file__ ).parent .resolve ()
68
69
UNIT_TEST_ROOT = (DIR / 'tests' ).resolve ()
@@ -1001,7 +1002,10 @@ def get_bool_env(name: str):
1001
1002
1002
1003
def main ():
1003
1004
is_mx_graalpytest = get_bool_env ('MX_GRAALPYTEST' )
1004
- parser = argparse .ArgumentParser (prog = ('mx graalpytest' if is_mx_graalpytest else None ))
1005
+ parser = argparse .ArgumentParser (
1006
+ prog = ('mx graalpytest' if is_mx_graalpytest else None ),
1007
+ formatter_class = argparse .RawTextHelpFormatter ,
1008
+ )
1005
1009
if is_mx_graalpytest :
1006
1010
# mx graalpytest takes this option, but it forwards --help here, so pretend we take it
1007
1011
parser .add_argument ('--python' , help = "Run tests with given Python binary" )
@@ -1018,7 +1022,7 @@ def main():
1018
1022
parser .add_argument ('-f' , '--failfast' , action = 'store_true' ,
1019
1023
help = "Exit immediately after the first failure" )
1020
1024
parser .add_argument ('--all' , action = 'store_true' ,
1021
- help = "Run tests that are normally not enabled due to tags" )
1025
+ help = "Run tests that are normally not enabled due to tags. Implies --tagged " )
1022
1026
parser .add_argument ('--retag' , dest = 'retag_mode' , action = 'store_const' , const = 'replace' ,
1023
1027
help = "Run tests and regenerate tags based on the results. Implies --all, --tagged and -n" )
1024
1028
parser .add_argument ('--retag-append' , dest = 'retag_mode' , action = 'store_const' , const = 'append' ,
@@ -1041,7 +1045,7 @@ def main():
1041
1045
] if IS_GRAALPY else [],
1042
1046
help = "Interpreter arguments to pass for subprocess invocation (when using -n)" )
1043
1047
parser .add_argument ('tests' , nargs = '+' , type = TestSpecifier .from_str ,
1044
- help = """
1048
+ help = dedent ( """
1045
1049
List of test specifiers. A specifier can be:
1046
1050
- A test file name. It will be looked up in our unittests or, if you pass --tagged, in tagged tests. Example: test_int
1047
1051
- A test file path. Example: graalpython/lib-python/3/test/test_int.py. Note you do not need to pass --tagged to refer to a tagged test by path
@@ -1051,7 +1055,7 @@ def main():
1051
1055
- You can use wildcards in tests paths and selectors. Example: 'test_int::test_create*'
1052
1056
1053
1057
Tip: the test IDs printed in test results directly work as specifiers here.
1054
- """ )
1058
+ """ ))
1055
1059
1056
1060
args = parser .parse_args ()
1057
1061
@@ -1060,6 +1064,9 @@ def main():
1060
1064
args .tagged = True
1061
1065
args .num_processes = args .num_processes or 1
1062
1066
1067
+ if args .all :
1068
+ args .tagged = True
1069
+
1063
1070
if get_bool_env ('GRAALPYTEST_FAIL_FAST' ):
1064
1071
args .failfast = True
1065
1072
0 commit comments