From b5137bc30bcb708aa462b00bf49e232bc947c09f Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Thu, 23 Nov 2017 22:22:48 +0700 Subject: [PATCH 1/3] Fix codecov data submission The use of `coverage combine` without multiple sets of data has been resulting in a warning `No data to combine` and the data not being submitted. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 07fdff6f..0e05ab04 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,4 +28,4 @@ after_script: - python debug-info.py after_success: - - if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then coverage combine && codecov; fi + - if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then codecov; fi From 943d8c37ad5217378193d8310f8bd312ed8f41ac Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Thu, 23 Nov 2017 11:59:03 +0700 Subject: [PATCH 2/3] Collect PyPy and AppVeyor coverage using tox Coverage of PyPy was disabled however it works without trouble, albeit a little slow. To allow tox to run tests under coverage, and with arguments passed to coverage, PYTEST_COMMAND can now be used to override the default command used to run the tests. Due to pips inability to deal with multiple requirements for the same package, six==1.9 is forcably installed after the tox environment has been setup. --- .appveyor.yml | 6 +++++- .travis.yml | 17 +++++++++-------- requirements-test.txt | 4 ++++ tox.ini | 18 ++++++++++-------- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index cbc93200..984e2b7f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -2,6 +2,7 @@ environment: global: PATH: "C:\\Python27\\Scripts\\;%PATH%" + PYTEST_COMMAND: "coverage run -m pytest" matrix: - TOXENV: py27-base - TOXENV: py27-optional @@ -16,7 +17,7 @@ environment: install: - git submodule update --init --recursive - - python -m pip install tox + - python -m pip install tox codecov build: off @@ -25,3 +26,6 @@ test_script: after_test: - python debug-info.py + +on_success: + - codecov diff --git a/.travis.yml b/.travis.yml index 0e05ab04..c2e65375 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,20 +12,21 @@ sudo: false cache: pip env: - - USE_OPTIONAL=true - - USE_OPTIONAL=false - - SIX_VERSION=1.9 USE_OPTIONAL=true + global: + - PYTEST_COMMAND="coverage run -m pytest" + matrix: + - TOXENV=optional + - TOXENV=base + - TOXENV=six19-optional install: - - ./requirements-install.sh + - pip install tox codecov script: - - if [[ $TRAVIS_PYTHON_VERSION == pypy* ]]; then py.test; fi - - if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then coverage run -m pytest; fi - - bash flake8-run.sh + - tox after_script: - python debug-info.py after_success: - - if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then codecov; fi + - codecov diff --git a/requirements-test.txt b/requirements-test.txt index 40df78d4..59513431 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,10 @@ -r requirements.txt +tox + flake8<3.0 + pytest +coverage pytest-expect>=1.1,<2.0 mock diff --git a/tox.ini b/tox.ini index 42492fb7..e07ef670 100644 --- a/tox.ini +++ b/tox.ini @@ -1,21 +1,23 @@ [tox] -envlist = {py27,py33,py34,py35,py36,pypy}-{base,optional} +envlist = {py27,py33,py34,py35,py36,pypy}-{base,six19,optional} [testenv] deps = - flake8<3.0 - pytest - pytest-expect>=1.1,<2.0 - mock - base: six - base: webencodings optional: -r{toxinidir}/requirements-optional.txt + -r{toxinidir}/requirements-test.txt doc: Sphinx +passenv = + PYTEST_COMMAND + COVERAGE_RUN_OPTIONS commands = - {envbindir}/py.test {posargs} + six19: pip install six==1.9 + {env:PYTEST_COMMAND:{envbindir}/py.test} {posargs} flake8 {toxinidir} [testenv:doc] changedir = doc commands = sphinx-build -b html . _build + +[flake8] +exclude = ./.tox From e17cf26c1c36befdce7da39aed1ead96fd0ad30e Mon Sep 17 00:00:00 2001 From: Will Kahn-Greene Date: Tue, 28 Nov 2017 19:20:46 -0500 Subject: [PATCH 3/3] Pin pytest to a version that doesn't require six --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 59513431..4e223a3f 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -4,7 +4,7 @@ tox flake8<3.0 -pytest +pytest==3.2.5 coverage pytest-expect>=1.1,<2.0 mock