From 2552b6312cc23845e66320321d5b3aa3141fca0e Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 26 Aug 2015 20:27:48 +1000 Subject: [PATCH] Add coveralls --- .coveragerc | 14 ++++++++++++++ .travis.yml | 6 +++++- tox.ini | 3 ++- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..f4e21b51 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,14 @@ +[run] +branch = True +source = + pymysql + + +[report] +exclude_lines = + pragma: no cover + except ImportError: + if DEBUG: + def __repr__ + def __str__ + raise NotImplementedError diff --git a/.travis.yml b/.travis.yml index 55891820..0e5d703e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,12 +23,16 @@ matrix: env: TOX_ENV=py34 install: - - pip install -U tox + - pip install -U tox coveralls before_script: - "mysql -e 'create database test_pymysql DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;'" - "mysql -e 'create database test_pymysql2 DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;'" - "mysql -e 'select VERSION();'" - cp .travis.databases.json pymysql/tests/databases.json + - export COVERALLS_PARALLEL=true + +after_success: + - coveralls script: tox -e $TOX_ENV diff --git a/tox.ini b/tox.ini index 008c00e2..dd67cd4c 100644 --- a/tox.ini +++ b/tox.ini @@ -2,5 +2,6 @@ envlist = py26,py27,py33,py34,pypy,pypy3 [testenv] -commands = ./runtests.py +commands = coverage run ./runtests.py deps = unittest2 + coverage