From 5a16dda50d228d7670bfa7467be7e6124369406f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastien=20G=C3=A9rard?= Date: Mon, 26 Aug 2019 17:12:56 +0300 Subject: [PATCH] fix coverage for pytest runner --- .travis.yml | 4 ++-- setup.py | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9d2ba8c1..2992d416 100644 --- a/.travis.yml +++ b/.travis.yml @@ -76,13 +76,13 @@ before_script: - mongo --eval 'db.version();' # Make sure mongo is awake script: - - tox -e $(echo py$TRAVIS_PYTHON_VERSION-mg$PYMONGO | tr -d . | sed -e 's/pypypy/pypy/') #-- --with-coverage + - tox -e $(echo py$TRAVIS_PYTHON_VERSION-mg$PYMONGO | tr -d . | sed -e 's/pypypy/pypy/') -- -a "--cov=mongoengine" # For now only submit coveralls for Python v2.7. Python v3.x currently shows # 0% coverage. That's caused by 'use_2to3', which builds the py3-compatible # code in a separate dir and runs tests on that. after_success: -- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coveralls --verbose; fi +- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then cat .coverage & coveralls --verbose; fi notifications: irc: irc.freenode.org#mongoengine diff --git a/setup.py b/setup.py index 81cc9744..94f71162 100644 --- a/setup.py +++ b/setup.py @@ -113,7 +113,13 @@ CLASSIFIERS = [ extra_opts = { "packages": find_packages(exclude=["tests", "tests.*"]), - "tests_require": ["pytest<5.0", "coverage==4.2", "blinker", "Pillow>=2.0.0"], + "tests_require": [ + "pytest<5.0", + "pytest-cov", + "coverage", + "blinker", + "Pillow>=2.0.0", + ], } if sys.version_info[0] == 3: extra_opts["use_2to3"] = True