summaryrefslogtreecommitdiff
path: root/tox.ini
diff options
context:
space:
mode:
authorshu-mutou <shu-mutou@rf.jp.nec.com>2015-12-02 15:31:04 +0900
committershu-mutou <shu-mutou@rf.jp.nec.com>2015-12-14 13:59:22 +0900
commit6bb97044c22b241c6b1e6d3e35df14131ca2547c (patch)
treead55881a07ce28ceb6a98f9fe09cb340c212ec7a /tox.ini
parenta564eb0e4cad452c5556c54c752ed896d0eb25af (diff)
downloadpython-swiftclient-6bb97044c22b241c6b1e6d3e35df14131ca2547c.tar.gz
Delete python bytecode before every test run
Because python creates pyc|pyo files and __pycache__ directories during tox runs, certain changes in the tree, like deletes of files, or switching branches, can create spurious errors. Change-Id: Ibaac514521bab11bbf552e0310d1203230c0d984 Closes-Bug: #1368661
Diffstat (limited to 'tox.ini')
-rw-r--r--tox.ini6
1 files changed, 5 insertions, 1 deletions
diff --git a/tox.ini b/tox.ini
index a467015..d7babc7 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,7 +10,11 @@ setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-commands = python setup.py testr --testr-args="{posargs}"
+commands = sh -c 'find . -not \( -type d -name .?\* -prune \) \
+ \( -type d -name "__pycache__" -or -type f -name "*.py[co]" \) \
+ -print0 | xargs -0 rm -rf'
+ python setup.py testr --testr-args="{posargs}"
+whitelist_externals = sh
passenv = SWIFT_* *_proxy
[testenv:pep8]