diff --git a/.travis.yml b/.travis.yml index 2992d416..cbf34cde 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ install: - pip install flake8 flake8-import-order - 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) - # 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" # Install black for Python v3.7 only. - 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 # code in a separate dir and runs tests on that. 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: irc: irc.freenode.org#mongoengine diff --git a/setup.py b/setup.py index 94f71162..2bc1ae1c 100644 --- a/setup.py +++ b/setup.py @@ -37,8 +37,9 @@ class PyTest(TestCommand): """ # 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"` + # This only works for 1 argument though user_options = [("pytest-args=", "a", "Arguments to pass to py.test")] def initialize_options(self): @@ -59,7 +60,6 @@ class PyTest(TestCommand): # re-import them from the build location. Required when 2to3 is used # with namespace packages. 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] if module in _namespace_packages: del_modules = [] @@ -78,11 +78,8 @@ class PyTest(TestCommand): ei_cmd = self.get_finalized_command("egg_info") 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 []) - print(cmd_args) errno = pytest.main(cmd_args) - sys.exit(errno) @@ -116,7 +113,7 @@ extra_opts = { "tests_require": [ "pytest<5.0", "pytest-cov", - "coverage", + "coverage<5.0", # recent coverage switched to sqlite format for the .coverage file which isn't handled properly by coveralls "blinker", "Pillow>=2.0.0", ],