|
36 | 36 | ]
|
37 | 37 |
|
38 | 38 |
|
| 39 | +# This must be enabled by explicitly including 'pytest-extra' on the command line |
| 40 | +PYTEST_OPT_IN = [PEP561] |
| 41 | + |
| 42 | + |
39 | 43 | # These must be enabled by explicitly including 'mypyc-extra' on the command line.
|
40 | 44 | MYPYC_OPT_IN = [MYPYC_RUN, MYPYC_RUN_MULTI]
|
41 | 45 |
|
| 46 | + |
42 | 47 | # We split the pytest run into three parts to improve test
|
43 | 48 | # parallelization. Each run should have tests that each take a roughly similar
|
44 | 49 | # time to run.
|
|
64 | 69 | ERROR_STREAM])],
|
65 | 70 |
|
66 | 71 | # 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)], |
69 | 73 |
|
70 | 74 | # Test cases to run in typeshed CI
|
71 | 75 | 'typeshed-ci': ['pytest', '-q', '-k', ' or '.join([CMDLINE,
|
72 | 76 | EVALUATION,
|
73 | 77 | SAMPLES,
|
74 | 78 | TYPESHED])],
|
| 79 | + |
75 | 80 | # Mypyc tests that aren't run by default, since they are slow and rarely
|
76 | 81 | # fail for commits that don't touch mypyc
|
77 | 82 | 'mypyc-extra': ['pytest', '-q', '-k', ' or '.join(MYPYC_OPT_IN)],
|
|
80 | 85 | # Stop run immediately if these commands fail
|
81 | 86 | FAST_FAIL = ['self', 'lint']
|
82 | 87 |
|
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] |
84 | 90 |
|
85 | 91 | assert all(cmd in cmds for cmd in FAST_FAIL)
|
86 | 92 |
|
@@ -124,7 +130,8 @@ def main() -> None:
|
124 | 130 | if not set(args).issubset(cmds):
|
125 | 131 | print("usage:", prog, " ".join('[%s]' % k for k in cmds))
|
126 | 132 | 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.') |
128 | 135 | exit(1)
|
129 | 136 |
|
130 | 137 | if not args:
|
|
0 commit comments