diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2020-07-03 02:54:32 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-07-12 12:00:28 -0400 |
commit | 9f47efe757762351ec12b4303e747ac0774db991 (patch) | |
tree | 6e01afc19b5ca8bcefcad8096d09999ca03e8e6e /conftest.py | |
parent | c897b90cbcd2d5a907d3b677f7229c2be7c44528 (diff) | |
download | external_python_setuptools-9f47efe757762351ec12b4303e747ac0774db991.tar.gz external_python_setuptools-9f47efe757762351ec12b4303e747ac0774db991.tar.bz2 external_python_setuptools-9f47efe757762351ec12b4303e747ac0774db991.zip |
Programmatically disable coverage when running on PyPy.
Diffstat (limited to 'conftest.py')
-rw-r--r-- | conftest.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/conftest.py b/conftest.py index 1746bfb5..0bc8d320 100644 --- a/conftest.py +++ b/conftest.py @@ -17,6 +17,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') |