Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pytest.sh')
-rwxr-xr-xtools/pytest.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/pytest.sh b/tools/pytest.sh
new file mode 100755
index 000000000..8e3619d5d
--- /dev/null
+++ b/tools/pytest.sh
@@ -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" "$@"