Commit 3319bfa7 authored by Jason R. Coombs's avatar Jason R. Coombs Committed by GitHub

Merge pull request #2254 from pypa/better-cov

Programmatically disable coverage when running on PyPy.
parents a4945970 9f47efe7
......@@ -19,6 +19,24 @@ collect_ignore = [
]
def pytest_configure(config):
disable_coverage_on_pypy(config)
def disable_coverage_on_pypy(config):
"""
Coverage makes tests on PyPy unbearably slow, so disable it.
"""
if '__pypy__' not in sys.builtin_module_names:
return
# Recommended at pytest-dev/pytest-cov#418
cov = config.pluginmanager.get_plugin('_cov')
cov.options.no_cov = True
if cov.cov_controller:
cov.cov_controller.pause()
if sys.version_info < (3,):
collect_ignore.append('setuptools/lib2to3_ex.py')
collect_ignore.append('setuptools/_imp.py')
......
......@@ -27,10 +27,6 @@ extras =
tests
[testenv:pypy{,3}]
commands = pytest --no-cov {posargs}
[testenv:coverage]
description=Combine coverage data and create report
deps=coverage
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment