From 6e936cdbee30836426234956e017db15297de708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Sun, 17 Feb 2019 17:15:04 +0200 Subject: [PATCH 1/8] Recreate the examples to solve common user problems regarding cov data aggregation and layout. --- MANIFEST.in | 2 +- example/.coveragerc | 2 -- example/setup.py | 7 ----- example/tests/test_mylib.py | 7 ----- example/tox.ini | 30 ------------------- examples/README.rst | 15 ++++++++++ examples/adhoc-layout/.coveragerc | 15 ++++++++++ .../adhoc-layout/example}/__init__.py | 0 examples/adhoc-layout/setup.py | 7 +++++ examples/adhoc-layout/tests/test_example.py | 6 ++++ examples/adhoc-layout/tox.ini | 23 ++++++++++++++ examples/src-layout/.coveragerc | 15 ++++++++++ examples/src-layout/setup.py | 8 +++++ examples/src-layout/src/example/__init__.py | 13 ++++++++ examples/src-layout/tests/test_example.py | 6 ++++ examples/src-layout/tox.ini | 25 ++++++++++++++++ 16 files changed, 134 insertions(+), 47 deletions(-) delete mode 100644 example/.coveragerc delete mode 100644 example/setup.py delete mode 100644 example/tests/test_mylib.py delete mode 100644 example/tox.ini create mode 100644 examples/README.rst create mode 100644 examples/adhoc-layout/.coveragerc rename {example/mylib => examples/adhoc-layout/example}/__init__.py (100%) create mode 100644 examples/adhoc-layout/setup.py create mode 100644 examples/adhoc-layout/tests/test_example.py create mode 100644 examples/adhoc-layout/tox.ini create mode 100644 examples/src-layout/.coveragerc create mode 100644 examples/src-layout/setup.py create mode 100644 examples/src-layout/src/example/__init__.py create mode 100644 examples/src-layout/tests/test_example.py create mode 100644 examples/src-layout/tox.ini diff --git a/MANIFEST.in b/MANIFEST.in index 8cc1538f..3889371f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ graft docs -graft example +graft examples graft src graft ci graft tests diff --git a/example/.coveragerc b/example/.coveragerc deleted file mode 100644 index 76f1eb15..00000000 --- a/example/.coveragerc +++ /dev/null @@ -1,2 +0,0 @@ -[run] -source = mylib \ No newline at end of file diff --git a/example/setup.py b/example/setup.py deleted file mode 100644 index 588af2e3..00000000 --- a/example/setup.py +++ /dev/null @@ -1,7 +0,0 @@ - -from setuptools import setup, find_packages - - -setup( - packages=find_packages() -) diff --git a/example/tests/test_mylib.py b/example/tests/test_mylib.py deleted file mode 100644 index f858b049..00000000 --- a/example/tests/test_mylib.py +++ /dev/null @@ -1,7 +0,0 @@ - -import mylib - - -def test_add(): - assert mylib.add(1, 1) == 2 - assert not mylib.add(0, 1) == 2 diff --git a/example/tox.ini b/example/tox.ini deleted file mode 100644 index 430b5331..00000000 --- a/example/tox.ini +++ /dev/null @@ -1,30 +0,0 @@ -[tox] -envlist = cov-init,py27,py34,cov-report - - -[testenv] -usedevelop=True -setenv = - COVERAGE_FILE = .coverage.{envname} -commands = pytest --cov --cov-report= {posargs} -deps = - ../cov-core - pytest - ../pytest-cov - - -[testenv:cov-init] -setenv = - COVERAGE_FILE = .coverage -deps = coverage -commands = - coverage erase - - -[testenv:cov-report] -setenv = - COVERAGE_FILE = .coverage -deps = coverage -commands = - coverage combine - coverage report diff --git a/examples/README.rst b/examples/README.rst new file mode 100644 index 00000000..a232f2a0 --- /dev/null +++ b/examples/README.rst @@ -0,0 +1,15 @@ +Simple examples with ``tox.ini`` +================================ + +These examples provide necessary configuration to: + +* aggregate coverage from multiple interpreters +* support tox parallel mode +* run tests on installed code + +The `adhoc` layout is the old and problematic layout where you can mix up the installed code +with the source code. However, these examples will provide correct configuration even for +the `adhoc` layout. + +The `src` layout configuration is less complicated, have that in mind when picking a layout +for your project. diff --git a/examples/adhoc-layout/.coveragerc b/examples/adhoc-layout/.coveragerc new file mode 100644 index 00000000..199d42e8 --- /dev/null +++ b/examples/adhoc-layout/.coveragerc @@ -0,0 +1,15 @@ +[paths] +source = + ../example + */site-packages/example + +[run] +branch = true +parallel = true +source = + example + . + +[report] +show_missing = true +precision = 2 diff --git a/example/mylib/__init__.py b/examples/adhoc-layout/example/__init__.py similarity index 100% rename from example/mylib/__init__.py rename to examples/adhoc-layout/example/__init__.py diff --git a/examples/adhoc-layout/setup.py b/examples/adhoc-layout/setup.py new file mode 100644 index 00000000..c6b05920 --- /dev/null +++ b/examples/adhoc-layout/setup.py @@ -0,0 +1,7 @@ +from setuptools import setup, find_packages + + +setup( + name='example', + packages=find_packages(include=['example']) +) diff --git a/examples/adhoc-layout/tests/test_example.py b/examples/adhoc-layout/tests/test_example.py new file mode 100644 index 00000000..f4948e66 --- /dev/null +++ b/examples/adhoc-layout/tests/test_example.py @@ -0,0 +1,6 @@ +import example + + +def test_add(): + assert example.add(1, 1) == 2 + assert not example.add(0, 1) == 2 diff --git a/examples/adhoc-layout/tox.ini b/examples/adhoc-layout/tox.ini new file mode 100644 index 00000000..8d05da79 --- /dev/null +++ b/examples/adhoc-layout/tox.ini @@ -0,0 +1,23 @@ +[tox] +envlist = clean,py27,py36,report + +[testenv] +commands = pytest --cov --cov-config={toxinidir}/.coveragerc --cov-report=term-missing --cov-append {posargs:-vv} +deps = + pytest + pytest-cov +depends = + {py27,py36}: clean + report: py27,py36 +changedir = tests + +[testenv:report] +deps = coverage +skip_install = true +commands = + coverage report + coverage html + +[testenv:clean] +commands = coverage erase +skip_install = true diff --git a/examples/src-layout/.coveragerc b/examples/src-layout/.coveragerc new file mode 100644 index 00000000..b4c80de2 --- /dev/null +++ b/examples/src-layout/.coveragerc @@ -0,0 +1,15 @@ +[paths] +source = + src + */site-packages + +[run] +branch = true +parallel = true +source = + example + tests + +[report] +show_missing = true +precision = 2 diff --git a/examples/src-layout/setup.py b/examples/src-layout/setup.py new file mode 100644 index 00000000..e1b59c8d --- /dev/null +++ b/examples/src-layout/setup.py @@ -0,0 +1,8 @@ +from setuptools import setup, find_packages + + +setup( + name='example', + packages=find_packages('src'), + package_dir={'': 'src'}, +) diff --git a/examples/src-layout/src/example/__init__.py b/examples/src-layout/src/example/__init__.py new file mode 100644 index 00000000..f014f944 --- /dev/null +++ b/examples/src-layout/src/example/__init__.py @@ -0,0 +1,13 @@ + +import sys + +PY3 = sys.version_info[0] == 3 + + +if PY3: + def add(a, b): + return a + b + +else: + def add(a, b): + return b + a diff --git a/examples/src-layout/tests/test_example.py b/examples/src-layout/tests/test_example.py new file mode 100644 index 00000000..f4948e66 --- /dev/null +++ b/examples/src-layout/tests/test_example.py @@ -0,0 +1,6 @@ +import example + + +def test_add(): + assert example.add(1, 1) == 2 + assert not example.add(0, 1) == 2 diff --git a/examples/src-layout/tox.ini b/examples/src-layout/tox.ini new file mode 100644 index 00000000..ce52faa8 --- /dev/null +++ b/examples/src-layout/tox.ini @@ -0,0 +1,25 @@ +[tox] +envlist = clean,py27,py36,report + +[tool:pytest] +testpaths = tests + +[testenv] +commands = pytest --cov --cov-report=term-missing --cov-append {posargs:-vv} +deps = + pytest + pytest-cov +depends = + {py27,py36}: clean + report: py27,py36 + +[testenv:report] +deps = coverage +skip_install = true +commands = + coverage report + coverage html + +[testenv:clean] +commands = coverage erase +skip_install = true From 6c31d6cdcbf68a8a1eb8f4d9eadce37bd1801748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Sat, 9 Mar 2019 18:08:11 +0200 Subject: [PATCH 2/8] Add a CLI reference section. Close #169. --- docs/config.rst | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/docs/config.rst b/docs/config.rst index 07b8f020..02a82a0e 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -8,9 +8,9 @@ further control of coverage use a coverage config file. For example if tests are contained within the directory tree being measured the tests may be excluded if desired by using a .coveragerc file with the omit option set:: - pytest --cov-config .coveragerc - --cov=myproj - myproj/tests/ + pytest --cov-config=.coveragerc + --cov=myproj + myproj/tests/ Where the .coveragerc file contains file globs:: @@ -41,3 +41,25 @@ In practical terms this means that if you have your coverage configuration in `` that you also use ``--cov-config=tox.ini`` or ``--cov-config=setup.cfg``. You might not be affected but it's unlikely that you won't ever use ``chdir`` in a test. + +Reference +========= + +The complete list of command line options is: + + --cov=PATH Measure coverage for filesystem path. (multi-allowed) + --cov-report=type Type of report to generate: term, term-missing, + annotate, html, xml (multi-allowed). term, term- + missing may be followed by ":skip-covered". annotate, + html and xml may be followed by ":DEST" where DEST + specifies the output location. Use --cov-report= to + not generate any output. + --cov-config=path Config file for coverage. Default: .coveragerc + --no-cov-on-fail Do not report coverage if test run fails. Default: + False + --no-cov Disable coverage report completely (useful for + debuggers). Default: False + --cov-fail-under=MIN Fail if the total coverage is less than MIN. + --cov-append Do not delete coverage but append to current. Default: + False + --cov-branch Enable branch coverage. From b0d30380bec5d7424daed6420891bc2b8e2442cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Sat, 9 Mar 2019 18:43:54 +0200 Subject: [PATCH 3/8] Fix the manifest collecting garbage from examples. --- MANIFEST.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 3889371f..4d9f082b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,10 @@ graft docs graft examples +prune examples/*/.tox +prune examples/*/htmlcov +prune examples/adhoc-layout/*.egg-info +prune examples/src-layout/src/*.egg-info + graft src graft ci graft tests @@ -19,4 +24,4 @@ include README.rst include tox.ini .travis.yml appveyor.yml -global-exclude *.py[cod] __pycache__ *.so +global-exclude *.py[cod] __pycache__ *.so .coverage From f211080ed64767a92214b0516672757ab4f27935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Sat, 9 Mar 2019 18:46:25 +0200 Subject: [PATCH 4/8] Document how to use it with tox. Close #170. --- docs/index.rst | 1 + docs/tox.rst | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 docs/tox.rst diff --git a/docs/index.rst b/docs/index.rst index eb27e7a0..494cd2df 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -12,6 +12,7 @@ Contents: debuggers xdist subprocess-support + tox plugins markers-fixtures changelog diff --git a/docs/tox.rst b/docs/tox.rst new file mode 100644 index 00000000..18f9137e --- /dev/null +++ b/docs/tox.rst @@ -0,0 +1,73 @@ +=== +Tox +=== + +When using `tox `_ you can have ultra-compact configuration - you can have all of it in +``tox.ini``:: + + [tox] + envlist = ... + + [tool:pytest] + ... + + [coverage:paths] + ... + + [coverage:run] + ... + + [coverage:report] + .. + + [testenv] + commands = ... + +An usual problem users have is that pytest-cov will erase the previous coverage data by default, thus if you run tox +with multiple environments you'll get incomplete coverage at the end. + +To prevent this problem you need to use ``--cov-append``. It's still recommended to clean the previous coverage data to +have consistent output. A ``tox.ini`` like this should be enough for sequential runs:: + + [tox] + envlist = clean,py27,py36,... + + [testenv] + commands = pytest --cov --cov-append --cov-report=term-missing ... + deps = + pytest + pytest-cov + + [testenv:clean] + deps = coverage + skip_install = true + commands = coverage erase + +For parallel runs we need to set some dependencies and have an extra report env like so:: + + [tox] + envlist = clean,py27,py36,report + + [testenv] + commands = pytest --cov --cov-append --cov-report=term-missing + deps = + pytest + pytest-cov + depends = + {py27,py36}: clean + report: py27,py36 + + [testenv:report] + deps = coverage + skip_install = true + commands = + coverage report + coverage html + + [testenv:clean] + deps = coverage + skip_install = true + commands = coverage erase + +Depending on your project layout you might need extra configuration, see the working examples at +https://github.com/pytest-dev/pytest-cov/tree/master/examples for two common layouts. From 14d77d917f87899009f514406e8b122a7cb3c2e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Sat, 9 Mar 2019 18:50:46 +0200 Subject: [PATCH 5/8] Minor fixes/cleanup. --- examples/adhoc-layout/tox.ini | 13 ++++++++++--- examples/src-layout/tox.ini | 11 +++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/examples/adhoc-layout/tox.ini b/examples/adhoc-layout/tox.ini index 8d05da79..24145f2d 100644 --- a/examples/adhoc-layout/tox.ini +++ b/examples/adhoc-layout/tox.ini @@ -1,23 +1,30 @@ [tox] envlist = clean,py27,py36,report +[tool:pytest] +addopts = + --cov-report=term-missing + [testenv] -commands = pytest --cov --cov-config={toxinidir}/.coveragerc --cov-report=term-missing --cov-append {posargs:-vv} +commands = pytest --cov --cov-append --cov-config={toxinidir}/.coveragerc {posargs:-vv} deps = pytest pytest-cov depends = {py27,py36}: clean report: py27,py36 + +# note that this is necessary to prevent the tests importing the code from your badly laid project changedir = tests [testenv:report] -deps = coverage skip_install = true +deps = coverage commands = coverage report coverage html [testenv:clean] -commands = coverage erase skip_install = true +deps = coverage +commands = coverage erase diff --git a/examples/src-layout/tox.ini b/examples/src-layout/tox.ini index ce52faa8..e5b1e644 100644 --- a/examples/src-layout/tox.ini +++ b/examples/src-layout/tox.ini @@ -3,23 +3,26 @@ envlist = clean,py27,py36,report [tool:pytest] testpaths = tests +addopts = + --cov-report=term-missing [testenv] -commands = pytest --cov --cov-report=term-missing --cov-append {posargs:-vv} +commands = pytest --cov --cov-append {posargs:-vv} deps = pytest pytest-cov -depends = +depends = {py27,py36}: clean report: py27,py36 [testenv:report] -deps = coverage skip_install = true +deps = coverage commands = coverage report coverage html [testenv:clean] -commands = coverage erase skip_install = true +deps = coverage +commands = coverage erase From 4df84b9f274df007117ab21e882bc71165bce5d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Sat, 9 Mar 2019 18:52:45 +0200 Subject: [PATCH 6/8] Correct punctuation/capitalization. --- src/pytest_cov/plugin.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pytest_cov/plugin.py b/src/pytest_cov/plugin.py index 8e69fd10..a5316dd5 100644 --- a/src/pytest_cov/plugin.py +++ b/src/pytest_cov/plugin.py @@ -55,11 +55,11 @@ def pytest_addoption(parser): 'cov', 'coverage reporting with distributed testing support') group.addoption('--cov', action='append', default=[], metavar='path', nargs='?', const=True, dest='cov_source', - help='measure coverage for filesystem path ' + help='Measure coverage for filesystem path. ' '(multi-allowed)') group.addoption('--cov-report', action=StoreReport, default={}, metavar='type', type=validate_report, - help='type of report to generate: term, term-missing, ' + help='Type of report to generate: term, term-missing, ' 'annotate, html, xml (multi-allowed). ' 'term, term-missing may be followed by ":skip-covered". ' 'annotate, html and xml may be followed by ":DEST" ' @@ -67,18 +67,18 @@ def pytest_addoption(parser): 'Use --cov-report= to not generate any output.') group.addoption('--cov-config', action='store', default='.coveragerc', metavar='path', - help='config file for coverage, default: .coveragerc') + help='Config file for coverage. Default: .coveragerc') group.addoption('--no-cov-on-fail', action='store_true', default=False, - help='do not report coverage if test run fails, ' - 'default: False') + help='Do not report coverage if test run fails. ' + 'Default: False') group.addoption('--no-cov', action='store_true', default=False, - help='Disable coverage report completely (useful for debuggers) ' - 'default: False') + help='Disable coverage report completely (useful for debuggers). ' + 'Default: False') group.addoption('--cov-fail-under', action='store', metavar='MIN', type=int, help='Fail if the total coverage is less than MIN.') group.addoption('--cov-append', action='store_true', default=False, - help='do not delete coverage but append to current, ' - 'default: False') + help='Do not delete coverage but append to current. ' + 'Default: False') group.addoption('--cov-branch', action='store_true', default=None, help='Enable branch coverage.') From 3f9dbaf9b2d8f9a350c34f17adca4c6102558662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Sun, 24 Mar 2019 15:52:07 +0200 Subject: [PATCH 7/8] Add ci for examples. --- .travis.yml | 84 ++++++++++++++++++++++++----------- ci/templates/.travis.yml | 27 ++++++++--- examples/adhoc-layout/tox.ini | 2 +- examples/src-layout/tox.ini | 2 +- 4 files changed, 81 insertions(+), 34 deletions(-) diff --git a/.travis.yml b/.travis.yml index d279ea3e..6d9e7677 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,74 +5,108 @@ env: global: - LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so - SEGFAULT_SIGNALS=all - matrix: - - TOXENV=check - - TOXENV=docs -matrix: +stages: + - lint + - examples + - tests +jobs: include: - - python: '2.7' + - stage: lint + env: + - TOXENV=check + - stage: lint + env: + - TOXENV=docs + - stage: tests + python: '2.7' env: - TOXENV=py27-t310-c45 - - python: '2.7' + - stage: tests + python: '2.7' env: - TOXENV=py27-t40-c45 - - python: '2.7' + - stage: tests + python: '2.7' env: - TOXENV=py27-t41-c45 - - python: '3.4' + - stage: tests + python: '3.4' env: - TOXENV=py34-t310-c45 - - python: '3.4' + - stage: tests + python: '3.4' env: - TOXENV=py34-t40-c45 - - python: '3.4' + - stage: tests + python: '3.4' env: - TOXENV=py34-t41-c45 - - python: '3.5' + - stage: tests + python: '3.5' env: - TOXENV=py35-t310-c45 - - python: '3.5' + - stage: tests + python: '3.5' env: - TOXENV=py35-t40-c45 - - python: '3.5' + - stage: tests + python: '3.5' env: - TOXENV=py35-t41-c45 - - python: '3.6' + - stage: tests + python: '3.6' env: - TOXENV=py36-t310-c45 - - python: '3.6' + - stage: tests + python: '3.6' env: - TOXENV=py36-t40-c45 - - python: '3.6' + - stage: tests + python: '3.6' env: - TOXENV=py36-t41-c45 - - python: '3.7' + - stage: tests + python: '3.7' env: - TOXENV=py37-t310-c45 - - python: '3.7' + - stage: tests + python: '3.7' env: - TOXENV=py37-t40-c45 - - python: '3.7' + - stage: tests + python: '3.7' env: - TOXENV=py37-t41-c45 - - python: 'pypy2.7-6.0' + - stage: tests + python: 'pypy2.7-6.0' env: - TOXENV=pypy-t310-c45 - - python: 'pypy2.7-6.0' + - stage: tests + python: 'pypy2.7-6.0' env: - TOXENV=pypy-t40-c45 - - python: 'pypy2.7-6.0' + - stage: tests + python: 'pypy2.7-6.0' env: - TOXENV=pypy-t41-c45 - - python: 'pypy3.5-6.0' + - stage: tests + python: 'pypy3.5-6.0' env: - TOXENV=pypy3-t310-c45 - - python: 'pypy3.5-6.0' + - stage: tests + python: 'pypy3.5-6.0' env: - TOXENV=pypy3-t40-c45 - - python: 'pypy3.5-6.0' + - stage: tests + python: 'pypy3.5-6.0' env: - TOXENV=pypy3-t41-c45 + - stage: examples + python: '3.6' + script: cd examples/src-layout; tox -v + - stage: examples + python: '3.6' + script: cd examples/adhoc-layout; tox -v before_install: - python --version - uname -a diff --git a/ci/templates/.travis.yml b/ci/templates/.travis.yml index 950d68e9..7ba94545 100644 --- a/ci/templates/.travis.yml +++ b/ci/templates/.travis.yml @@ -5,22 +5,35 @@ env: global: - LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so - SEGFAULT_SIGNALS=all - matrix: - - TOXENV=check - - TOXENV=docs -matrix: +stages: + - lint + - examples + - tests +jobs: include: + - stage: lint + env: + - TOXENV=check + - stage: lint + env: + - TOXENV=docs {%- for env in tox_environments %}{{ '' }} + - stage: tests {% if env.startswith("pypy-") %} - - python: 'pypy2.7-6.0' + python: 'pypy2.7-6.0' {% elif env.startswith("pypy3-") %} - - python: 'pypy3.5-6.0' + python: 'pypy3.5-6.0' {% else %} - - python: '{{ "{0[2]}.{0[3]}".format(env) }}' + python: '{{ "{0[2]}.{0[3]}".format(env) }}' {% endif %} env: - TOXENV={{ env }}{% if 'cover' in env %},report,coveralls,codecov{% endif -%} {%- endfor %}{{ '' }} +{%- for kind in ['src', 'adhoc'] %}{{ '' }} + - stage: examples + python: '3.6' + script: cd examples/{{ kind }}-layout; tox -v +{%- endfor %}{{ '' }} before_install: - python --version - uname -a diff --git a/examples/adhoc-layout/tox.ini b/examples/adhoc-layout/tox.ini index 24145f2d..2e089305 100644 --- a/examples/adhoc-layout/tox.ini +++ b/examples/adhoc-layout/tox.ini @@ -21,8 +21,8 @@ changedir = tests skip_install = true deps = coverage commands = - coverage report coverage html + coverage report --fail-under=100 [testenv:clean] skip_install = true diff --git a/examples/src-layout/tox.ini b/examples/src-layout/tox.ini index e5b1e644..40088dfe 100644 --- a/examples/src-layout/tox.ini +++ b/examples/src-layout/tox.ini @@ -19,8 +19,8 @@ depends = skip_install = true deps = coverage commands = - coverage report coverage html + coverage report --fail-under=100 [testenv:clean] skip_install = true From 8df575e78aa81f720616ba427e0f4061f1b29e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Sun, 24 Mar 2019 22:58:42 +0200 Subject: [PATCH 8/8] Make it look prettier in travis. --- .travis.yml | 8 ++++++-- ci/templates/.travis.yml | 6 ++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6d9e7677..611ed370 100644 --- a/.travis.yml +++ b/.travis.yml @@ -103,10 +103,14 @@ jobs: - TOXENV=pypy3-t41-c45 - stage: examples python: '3.6' - script: cd examples/src-layout; tox -v + script: cd $TARGET; tox -v + env: + - TARGET=examples/src-layout - stage: examples python: '3.6' - script: cd examples/adhoc-layout; tox -v + script: cd $TARGET; tox -v + env: + - TARGET=examples/adhoc-layout before_install: - python --version - uname -a diff --git a/ci/templates/.travis.yml b/ci/templates/.travis.yml index 7ba94545..b5eccdff 100644 --- a/ci/templates/.travis.yml +++ b/ci/templates/.travis.yml @@ -29,10 +29,12 @@ jobs: env: - TOXENV={{ env }}{% if 'cover' in env %},report,coveralls,codecov{% endif -%} {%- endfor %}{{ '' }} -{%- for kind in ['src', 'adhoc'] %}{{ '' }} +{%- for example in ['src', 'adhoc'] %}{{ '' }} - stage: examples python: '3.6' - script: cd examples/{{ kind }}-layout; tox -v + script: cd $TARGET; tox -v + env: + - TARGET=examples/{{ example }}-layout {%- endfor %}{{ '' }} before_install: - python --version