summaryrefslogtreecommitdiff
path: root/tox.ini
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2017-01-17 20:54:04 -0500
committerNed Batchelder <ned@nedbatchelder.com>2017-01-17 20:54:04 -0500
commitde0ed517729fcf43dbdf2e9db3ce2db20b62b534 (patch)
tree513c49dce90b16dd86686bf5ff34bdb579d0170a /tox.ini
parent854e13ae9290e2bc1013043bf0dbd83840f3b345 (diff)
downloadpython-coveragepy-de0ed517729fcf43dbdf2e9db3ce2db20b62b534.tar.gz
Prevent race conditions from failing tests during 'import usepkgs'
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini7
1 files changed, 7 insertions, 0 deletions
diff --git a/tox.ini b/tox.ini
index ea36b80..4e0b9ed 100644
--- a/tox.ini
+++ b/tox.ini
@@ -38,6 +38,13 @@ commands =
# Remove the C extension so that we can test the PyTracer
python igor.py zip_mods install_egg remove_extension
+ # When running parallel tests, many processes might all try to import the
+ # same modules at once. This should be safe, but especially on Python 3.3,
+ # this caused a number of test failures trying to import usepkgs. To
+ # prevent the race condition, pre-compile the tests/modules directory.
+ py33: python -m compileall -q -f tests/modules
+ py33: python -c "import time; time.sleep(1.1)"
+
# Test with the PyTracer
python igor.py test_with_tracer py {posargs}