From f3d02aa3b088e2f9044fe5e4869e8c8cb91d2cdc Mon Sep 17 00:00:00 2001 From: Hugo Date: Sat, 5 Oct 2019 23:31:03 +0300 Subject: [PATCH] Test with pytest and send coverage to Codecov --- .coveragerc | 10 ++++++++++ .gitignore | 4 ++++ .travis.yml | 10 +++++++++- README.md | 1 + 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..0ab42b3e --- /dev/null +++ b/.coveragerc @@ -0,0 +1,10 @@ +# .coveragerc to control coverage.py + +[report] +# Regexes for lines to exclude from consideration +exclude_lines = + # Have to re-enable the standard pragma: + pragma: no cover + + # Don't complain if non-runnable code isn't run: + if __name__ == .__main__.: diff --git a/.gitignore b/.gitignore index d6fdabdc..432f8e08 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,7 @@ junit-py27.xml # pyenv noise .python-version tablib.egg-info/* + +# Coverage +.coverage +htmlcov diff --git a/.travis.yml b/.travis.yml index f9f13cc1..79a51758 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: python cache: pip + matrix: include: - python: 2.7 @@ -7,6 +8,13 @@ matrix: - python: 3.6 - python: 3.7 - python: 3.8-dev + install: - pip install -r requirements.txt -script: python test_tablib.py + - pip install -U pytest pytest-cov + +script: pytest --cov tablib + +after_success: + - pip install -U codecov + - codecov diff --git a/README.md b/README.md index 34a30700..b527e84c 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Jazzband](https://jazzband.co/static/img/badge.svg)](https://jazzband.co/) [![Build Status](https://travis-ci.org/jazzband/tablib.svg?branch=master)](https://travis-ci.org/jazzband/tablib) +[![codecov](https://codecov.io/gh/jazzband/tablib/branch/master/graph/badge.svg)](https://codecov.io/gh/jazzband/tablib) _____ ______ ___________ ______ __ /_______ ____ /_ ___ /___(_)___ /_