fix for recent coverage/coveralls compatibility issue
This commit is contained in:
parent
5a16dda50d
commit
51ea3e3c6f
@ -63,7 +63,7 @@ install:
|
|||||||
- pip install flake8 flake8-import-order
|
- pip install flake8 flake8-import-order
|
||||||
- pip install tox # tox 3.11.0 has requirement virtualenv>=14.0.0
|
- pip install tox # tox 3.11.0 has requirement virtualenv>=14.0.0
|
||||||
- pip install virtualenv # virtualenv>=14.0.0 has dropped Python 3.2 support (and pypy3 is based on py32)
|
- pip install virtualenv # virtualenv>=14.0.0 has dropped Python 3.2 support (and pypy3 is based on py32)
|
||||||
# Install the tox venv (we make pytest avoid running the test by giving a bad pattern)
|
# tox dryrun to setup the tox venv (we run a mock test).
|
||||||
- tox -e $(echo py$TRAVIS_PYTHON_VERSION-mg$PYMONGO | tr -d . | sed -e 's/pypypy/pypy/') -- -a "-k=test_ci_placeholder"
|
- tox -e $(echo py$TRAVIS_PYTHON_VERSION-mg$PYMONGO | tr -d . | sed -e 's/pypypy/pypy/') -- -a "-k=test_ci_placeholder"
|
||||||
# Install black for Python v3.7 only.
|
# Install black for Python v3.7 only.
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]]; then pip install black; fi
|
- if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]]; then pip install black; fi
|
||||||
@ -82,7 +82,7 @@ script:
|
|||||||
# 0% coverage. That's caused by 'use_2to3', which builds the py3-compatible
|
# 0% coverage. That's caused by 'use_2to3', which builds the py3-compatible
|
||||||
# code in a separate dir and runs tests on that.
|
# code in a separate dir and runs tests on that.
|
||||||
after_success:
|
after_success:
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then cat .coverage & coveralls --verbose; fi
|
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then coveralls --verbose; else echo "coveralls only sent for py27"; fi
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
irc: irc.freenode.org#mongoengine
|
irc: irc.freenode.org#mongoengine
|
||||||
|
9
setup.py
9
setup.py
@ -37,8 +37,9 @@ class PyTest(TestCommand):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# https://pytest.readthedocs.io/en/2.7.3/goodpractises.html#integration-with-setuptools-test-commands
|
# https://pytest.readthedocs.io/en/2.7.3/goodpractises.html#integration-with-setuptools-test-commands
|
||||||
# Allows to provide pytest command arguments through the test runner command `python setup.py test`
|
# Allows to provide pytest command argument through the test runner command `python setup.py test`
|
||||||
# e.g: `python setup.py test -a "-k=test"`
|
# e.g: `python setup.py test -a "-k=test"`
|
||||||
|
# This only works for 1 argument though
|
||||||
user_options = [("pytest-args=", "a", "Arguments to pass to py.test")]
|
user_options = [("pytest-args=", "a", "Arguments to pass to py.test")]
|
||||||
|
|
||||||
def initialize_options(self):
|
def initialize_options(self):
|
||||||
@ -59,7 +60,6 @@ class PyTest(TestCommand):
|
|||||||
# re-import them from the build location. Required when 2to3 is used
|
# re-import them from the build location. Required when 2to3 is used
|
||||||
# with namespace packages.
|
# with namespace packages.
|
||||||
if sys.version_info >= (3,) and getattr(self.distribution, "use_2to3", False):
|
if sys.version_info >= (3,) and getattr(self.distribution, "use_2to3", False):
|
||||||
print("Hack for 2to3", self.test_args)
|
|
||||||
module = self.test_args[-1].split(".")[0]
|
module = self.test_args[-1].split(".")[0]
|
||||||
if module in _namespace_packages:
|
if module in _namespace_packages:
|
||||||
del_modules = []
|
del_modules = []
|
||||||
@ -78,11 +78,8 @@ class PyTest(TestCommand):
|
|||||||
ei_cmd = self.get_finalized_command("egg_info")
|
ei_cmd = self.get_finalized_command("egg_info")
|
||||||
self.test_args = [normalize_path(ei_cmd.egg_base)]
|
self.test_args = [normalize_path(ei_cmd.egg_base)]
|
||||||
|
|
||||||
print(self.test_args, self.pytest_args)
|
|
||||||
cmd_args = self.test_args + ([self.pytest_args] if self.pytest_args else [])
|
cmd_args = self.test_args + ([self.pytest_args] if self.pytest_args else [])
|
||||||
print(cmd_args)
|
|
||||||
errno = pytest.main(cmd_args)
|
errno = pytest.main(cmd_args)
|
||||||
|
|
||||||
sys.exit(errno)
|
sys.exit(errno)
|
||||||
|
|
||||||
|
|
||||||
@ -116,7 +113,7 @@ extra_opts = {
|
|||||||
"tests_require": [
|
"tests_require": [
|
||||||
"pytest<5.0",
|
"pytest<5.0",
|
||||||
"pytest-cov",
|
"pytest-cov",
|
||||||
"coverage",
|
"coverage<5.0", # recent coverage switched to sqlite format for the .coverage file which isn't handled properly by coveralls
|
||||||
"blinker",
|
"blinker",
|
||||||
"Pillow>=2.0.0",
|
"Pillow>=2.0.0",
|
||||||
],
|
],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user