Commit 662816b6 authored by Jason R. Coombs's avatar Jason R. Coombs Committed by GitHub

Merge pull request #2388 from pypa/feature/plugins-enabled-by-default

Enable flake8 and cov plugins only when installed.
parents 2995140f 897f409c
...@@ -8,18 +8,22 @@ environment: ...@@ -8,18 +8,22 @@ environment:
matrix: matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
APPVEYOR_JOB_NAME: "python35-x64-vs2015" APPVEYOR_JOB_NAME: "Python38-x64-vs2015"
PYTHON: "C:\\Python35-x64" PYTHON: "C:\\Python38-x64"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
APPVEYOR_JOB_NAME: "python35-x64-vs2017" APPVEYOR_JOB_NAME: "Python38-x64-vs2017"
PYTHON: "C:\\Python35-x64" PYTHON: "C:\\Python38-x64"
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
APPVEYOR_JOB_NAME: "python35-x64-vs2019" APPVEYOR_JOB_NAME: "Python38-x64-vs2019"
PYTHON: "C:\\Python35-x64" PYTHON: "C:\\Python38-x64"
- APPVEYOR_JOB_NAME: "python36-x64"
PYTHON: "C:\\Python36-x64"
- APPVEYOR_JOB_NAME: "python37-x64" - APPVEYOR_JOB_NAME: "python37-x64"
PYTHON: "C:\\Python37-x64" PYTHON: "C:\\Python37-x64"
- APPVEYOR_JOB_NAME: "python36-x64"
PYTHON: "C:\\Python36-x64"
- APPVEYOR_JOB_NAME: "python35-x64"
PYTHON: "C:\\Python35-x64"
PYTEST_ADDOPTS: "--cov"
TOX_TESTENV_PASSENV: "PYTEST_ADDOPTS"
install: install:
# symlink python from a directory with a space # symlink python from a directory with a space
...@@ -37,7 +41,7 @@ test_script: ...@@ -37,7 +41,7 @@ test_script:
- python -m pip install --disable-pip-version-check --upgrade pip setuptools wheel - python -m pip install --disable-pip-version-check --upgrade pip setuptools wheel
- pip install --upgrade tox tox-venv virtualenv - pip install --upgrade tox tox-venv virtualenv
- pip freeze --all - pip freeze --all
- tox -- --cov - tox
after_test: after_test:
- tox -e coverage,codecov - tox -e coverage,codecov
......
...@@ -19,23 +19,5 @@ collect_ignore = [ ...@@ -19,23 +19,5 @@ 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, 6): if sys.version_info < (3, 6):
collect_ignore.append('pavement.py') collect_ignore.append('pavement.py')
...@@ -41,3 +41,9 @@ backend-path = ["."] ...@@ -41,3 +41,9 @@ backend-path = ["."]
directory = "misc" directory = "misc"
name = "Misc" name = "Misc"
showcontent = true showcontent = true
[tool.jaraco.pytest.plugins.flake8]
addopts = "--flake8"
[tool.jaraco.pytest.plugins.cov]
addopts = "--cov"
[pytest] [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 norecursedirs=dist build *.egg setuptools/extern pkg_resources/extern pkg_resources/tests/data tools .* setuptools/_vendor pkg_resources/_vendor
doctest_optionflags=ELLIPSIS ALLOW_UNICODE doctest_optionflags=ELLIPSIS ALLOW_UNICODE
filterwarnings = filterwarnings =
......
...@@ -68,10 +68,12 @@ tests = ...@@ -68,10 +68,12 @@ tests =
pytest>=3.7 pytest>=3.7
wheel wheel
coverage>=4.5.1 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" paver; python_version>="3.6"
pip>=19.1 # For proper file:// URLs support. pip>=19.1 # For proper file:// URLs support.
jaraco.envs jaraco.envs
jaraco.test >= 3.1.1; python_version >= "3.6"
docs = docs =
# Keep these in sync with docs/requirements.txt # Keep these in sync with docs/requirements.txt
......
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