Skip to content

Commit 8514a2a

Browse files
shorten the test, improve pypy compatbility
1 parent 070fa60 commit 8514a2a

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

pyperformance/benchmarks/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@
7171
'mypy_types',
7272
]
7373

74-
if platform.python_implementation() == "CPython":
74+
IS_CPYTHON = platform.python_implementation() == "CPython"
75+
76+
if IS_CPYTHON:
7577
DEFAULT_GROUP.extend(CPYTHON_ONLY_GROUP)
7678

7779
BENCH_GROUPS = {
@@ -297,9 +299,9 @@ def BM_sqlalchemy_imperative(python, options):
297299
def BM_mdp(python, options):
298300
return run_perf_script(python, options, "mdp")
299301

300-
301-
def BM_mypy_types(python, options):
302-
return run_perf_script(python, options, "mypy_types")
302+
if IS_CPYTHON:
303+
def BM_mypy_types(python, options):
304+
return run_perf_script(python, options, "mypy_types")
303305

304306
# End benchmarks, begin main entry point support.
305307

pyperformance/benchmarks/bm_mypy_types.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515

1616
def typecheck_targets(targets):
1717
with open(os.devnull, 'w') as devnull:
18-
for _ in range(10):
19-
try:
20-
main(None, devnull, devnull, targets)
21-
except SystemExit:
22-
pass
18+
try:
19+
main(None, devnull, devnull, targets)
20+
except SystemExit:
21+
pass
2322

2423

2524
if __name__ == '__main__':

0 commit comments

Comments
 (0)