diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2020-09-14 19:05:13 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-09-14 19:05:13 -0400 |
commit | f01d2719802d3345332b761fb1c62fa4afd212c9 (patch) | |
tree | 4699b9097e29ef07e915dea53cedad1537ace744 | |
parent | f84c145482d273cd6b90e20012443edcfd59ff0d (diff) | |
download | python-setuptools-git-f01d2719802d3345332b761fb1c62fa4afd212c9.tar.gz |
Enable flake8 and cov plugins only when installed. Avoid installing in PyPy.
-rw-r--r-- | conftest.py | 18 | ||||
-rw-r--r-- | pyproject.toml | 6 | ||||
-rw-r--r-- | pytest.ini | 2 | ||||
-rw-r--r-- | setup.cfg | 4 |
4 files changed, 10 insertions, 20 deletions
diff --git a/conftest.py b/conftest.py index 25537f56..90090253 100644 --- a/conftest.py +++ b/conftest.py @@ -19,24 +19,6 @@ 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') diff --git a/pyproject.toml b/pyproject.toml index cfdc2574..cd66e277 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,3 +41,9 @@ backend-path = ["."] directory = "misc" name = "Misc" showcontent = true + +[tool.jaraco.pytest.plugins.flake8] +addopts = "--flake8" + +[tool.jaraco.pytest.plugins.cov] +addopts = "--cov" @@ -1,5 +1,5 @@ [pytest] -addopts=--doctest-modules --flake8 --doctest-glob=pkg_resources/api_tests.txt --cov -r sxX +addopts=--doctest-modules --doctest-glob=pkg_resources/api_tests.txt -r sxX norecursedirs=dist build *.egg setuptools/extern pkg_resources/extern pkg_resources/tests/data tools .* setuptools/_vendor pkg_resources/_vendor doctest_optionflags=ELLIPSIS ALLOW_UNICODE filterwarnings = @@ -68,10 +68,12 @@ tests = pytest>=3.7 wheel coverage>=4.5.1 - pytest-cov>=2.5.1 + # Coverage is unbearably slow on PyPy + pytest-cov>=2.5.1; python_implementation != "PyPy" paver; python_version>="3.6" pip>=19.1 # For proper file:// URLs support. jaraco.envs + jaraco.test >= 3.1.1 docs = # Keep these in sync with docs/requirements.txt |