Fix pytest on macOS in Travis (#5360)

* Add tools/pytest.sh

* pass TRAVIS through in tox.ini

* Use tools/pytest.sh to run pytest

* Add quiet to pytest.ini

* ignore pytest cache
This commit is contained in:
Brad Warren
2018-01-03 17:49:22 -08:00
committed by ohemorange
parent ed2168aaa8
commit 5388842e5b
6 changed files with 32 additions and 2 deletions
+1 -1
View File
@@ -23,5 +23,5 @@ for requirement in "$@" ; do
# See https://travis-ci.org/certbot/certbot/jobs/308774157#L1333.
pkg=$(echo "$pkg" | tr - _)
fi
pytest --numprocesses auto --quiet --pyargs $pkg
"$(dirname $0)/pytest.sh" --pyargs $pkg
done
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
# Runs pytest with the provided arguments, adding --numprocesses to the command
# line. This argument is set to "auto" if the environmnent variable TRAVIS is
# not set, otherwise, it is set to 2. This works around
# https://github.com/pytest-dev/pytest-xdist/issues/9. Currently every Travis
# environnment provides two cores. See
# https://docs.travis-ci.com/user/reference/overview/#Virtualization-environments.
if ${TRAVIS:-false}; then
NUMPROCESSES="2"
else
NUMPROCESSES="auto"
fi
pytest --numprocesses "$NUMPROCESSES" "$@"