Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 615c207

Browse files
authored
Categorize some stubgen tests as slow tests (#6340)
This allows pytest to parallelize tests more effectively and seems to make the test suite faster by ~5 seconds or so on my Linux desktop. These can use typeshed so they are not fast tests. Some of the StubgenPython tests are fast but others aren't. I'm classifying them as slow since it looks like this is generally better for scheduling, but it might be even better to split the suite into fast and slow parts.
1 parent 15e9b5b commit 615c207

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

runtests.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,17 @@
2121
PEP561 = 'TestPEP561'
2222
EVALUATION = 'PythonEvaluation'
2323
DAEMON = 'testdaemon'
24+
STUBGEN_CMD = 'StubgenCmdLine'
25+
STUBGEN_PY = 'StubgenPythonSuite'
2426

25-
ALL_NON_FAST = [CMDLINE, SAMPLES, TYPESHED, PEP561, EVALUATION, DAEMON]
27+
ALL_NON_FAST = [CMDLINE,
28+
SAMPLES,
29+
TYPESHED,
30+
PEP561,
31+
EVALUATION,
32+
DAEMON,
33+
STUBGEN_CMD,
34+
STUBGEN_PY]
2635

2736
# We split the pytest run into three parts to improve test
2837
# parallelization. Each run should have tests that each take a roughly similiar
@@ -35,7 +44,10 @@
3544
# Fast test cases only (this is the bulk of the test suite)
3645
'pytest-fast': 'pytest -k "not (%s)"' % ' or '.join(ALL_NON_FAST),
3746
# Test cases that invoke mypy (with small inputs)
38-
'pytest-cmdline': 'pytest -k "%s"' % ' or '.join([CMDLINE, EVALUATION]),
47+
'pytest-cmdline': 'pytest -k "%s"' % ' or '.join([CMDLINE,
48+
EVALUATION,
49+
STUBGEN_CMD,
50+
STUBGEN_PY]),
3951
# Test cases that may take seconds to run each
4052
'pytest-slow': 'pytest -k "%s"' % ' or '.join([SAMPLES, TYPESHED, PEP561, DAEMON]),
4153
}

0 commit comments

Comments
 (0)