aboutsummaryrefslogtreecommitdiffstats
path: root/conftest.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-07-12 12:07:31 -0400
committerGitHub <noreply@github.com>2020-07-12 12:07:31 -0400
commit3319bfa7099d9b668e1560688a07687cdef7fe36 (patch)
treedb743af7e227b016f4e014cc854772054fa9eea5 /conftest.py
parenta4945970acae9c654715871a08803d67d9bd3527 (diff)
parent9f47efe757762351ec12b4303e747ac0774db991 (diff)
downloadexternal_python_setuptools-3319bfa7099d9b668e1560688a07687cdef7fe36.tar.gz
external_python_setuptools-3319bfa7099d9b668e1560688a07687cdef7fe36.tar.bz2
external_python_setuptools-3319bfa7099d9b668e1560688a07687cdef7fe36.zip
Merge pull request #2254 from pypa/better-cov
Programmatically disable coverage when running on PyPy.
Diffstat (limited to 'conftest.py')
-rw-r--r--conftest.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/conftest.py b/conftest.py
index 50cc6509..6013e187 100644
--- a/conftest.py
+++ b/conftest.py
@@ -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')