Skip to content

Commit e781640

Browse files
committed
Make --all imply --tagged
1 parent 4df3d92 commit e781640

File tree

1 file changed

+11
-4
lines changed
  • graalpython/com.oracle.graal.python.test/src

1 file changed

+11
-4
lines changed

graalpython/com.oracle.graal.python.test/src/runner.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
from dataclasses import dataclass, field
6464
from functools import lru_cache
6565
from pathlib import Path
66+
from textwrap import dedent
6667

6768
DIR = Path(__file__).parent.resolve()
6869
UNIT_TEST_ROOT = (DIR / 'tests').resolve()
@@ -1001,7 +1002,10 @@ def get_bool_env(name: str):
10011002

10021003
def main():
10031004
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+
)
10051009
if is_mx_graalpytest:
10061010
# mx graalpytest takes this option, but it forwards --help here, so pretend we take it
10071011
parser.add_argument('--python', help="Run tests with given Python binary")
@@ -1018,7 +1022,7 @@ def main():
10181022
parser.add_argument('-f', '--failfast', action='store_true',
10191023
help="Exit immediately after the first failure")
10201024
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")
10221026
parser.add_argument('--retag', dest='retag_mode', action='store_const', const='replace',
10231027
help="Run tests and regenerate tags based on the results. Implies --all, --tagged and -n")
10241028
parser.add_argument('--retag-append', dest='retag_mode', action='store_const', const='append',
@@ -1041,7 +1045,7 @@ def main():
10411045
] if IS_GRAALPY else [],
10421046
help="Interpreter arguments to pass for subprocess invocation (when using -n)")
10431047
parser.add_argument('tests', nargs='+', type=TestSpecifier.from_str,
1044-
help="""
1048+
help=dedent("""
10451049
List of test specifiers. A specifier can be:
10461050
- A test file name. It will be looked up in our unittests or, if you pass --tagged, in tagged tests. Example: test_int
10471051
- 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():
10511055
- You can use wildcards in tests paths and selectors. Example: 'test_int::test_create*'
10521056
10531057
Tip: the test IDs printed in test results directly work as specifiers here.
1054-
""")
1058+
"""))
10551059

10561060
args = parser.parse_args()
10571061

@@ -1060,6 +1064,9 @@ def main():
10601064
args.tagged = True
10611065
args.num_processes = args.num_processes or 1
10621066

1067+
if args.all:
1068+
args.tagged = True
1069+
10631070
if get_bool_env('GRAALPYTEST_FAIL_FAST'):
10641071
args.failfast = True
10651072

0 commit comments

Comments
 (0)