Skip to content

Commit 2051024

Browse files
Make PEP561 tests opt-in (fix #12879) (#12883)
1 parent 568b98a commit 2051024

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

runtests.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@
3636
]
3737

3838

39+
# This must be enabled by explicitly including 'pytest-extra' on the command line
40+
PYTEST_OPT_IN = [PEP561]
41+
42+
3943
# These must be enabled by explicitly including 'mypyc-extra' on the command line.
4044
MYPYC_OPT_IN = [MYPYC_RUN, MYPYC_RUN_MULTI]
4145

46+
4247
# We split the pytest run into three parts to improve test
4348
# parallelization. Each run should have tests that each take a roughly similar
4449
# time to run.
@@ -64,14 +69,14 @@
6469
ERROR_STREAM])],
6570

6671
# Test cases that might take minutes to run
67-
'pytest-slower': ['pytest', '-q', '-k', ' or '.join(
68-
[PEP561])],
72+
'pytest-extra': ['pytest', '-q', '-k', ' or '.join(PYTEST_OPT_IN)],
6973

7074
# Test cases to run in typeshed CI
7175
'typeshed-ci': ['pytest', '-q', '-k', ' or '.join([CMDLINE,
7276
EVALUATION,
7377
SAMPLES,
7478
TYPESHED])],
79+
7580
# Mypyc tests that aren't run by default, since they are slow and rarely
7681
# fail for commits that don't touch mypyc
7782
'mypyc-extra': ['pytest', '-q', '-k', ' or '.join(MYPYC_OPT_IN)],
@@ -80,7 +85,8 @@
8085
# Stop run immediately if these commands fail
8186
FAST_FAIL = ['self', 'lint']
8287

83-
DEFAULT_COMMANDS = [cmd for cmd in cmds if cmd not in ('mypyc-extra', 'typeshed-ci')]
88+
EXTRA_COMMANDS = ('pytest-extra', 'mypyc-extra', 'typeshed-ci')
89+
DEFAULT_COMMANDS = [cmd for cmd in cmds if cmd not in EXTRA_COMMANDS]
8490

8591
assert all(cmd in cmds for cmd in FAST_FAIL)
8692

@@ -124,7 +130,8 @@ def main() -> None:
124130
if not set(args).issubset(cmds):
125131
print("usage:", prog, " ".join('[%s]' % k for k in cmds))
126132
print()
127-
print('Run the given tests. If given no arguments, run everything except mypyc-extra.')
133+
print('Run the given tests. If given no arguments, run everything except'
134+
+ ' pytest-extra and mypyc-extra.')
128135
exit(1)
129136

130137
if not args:

0 commit comments

Comments
 (0)