From d6efb3221e371e3a3a31edeba64db6f26606025a Mon Sep 17 00:00:00 2001 From: Eli Qiao Date: Sun, 6 Sep 2015 11:36:16 +0800 Subject: [PATCH] tox: rm all pyc before doing unit test Delete python bytecode before every test run. Because python creates pyc files during tox runs, certain changes in the tree, like deletes of files, or switching branches, can create spurious errors. Closes-Bug: #1368661 Change-Id: I7e563875848acc7ec767f97b31fc8a95b23ee880 --- tox.ini | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index ac82763f0b..2aca904127 100644 --- a/tox.ini +++ b/tox.ini @@ -6,11 +6,14 @@ skipsdist = True [testenv] usedevelop = True install_command = pip install -U {opts} {packages} +whitelist_externals = find setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands = python setup.py testr --slowest --testr-args='{posargs}' +commands = + find . -type f -name "*.pyc" -delete + python setup.py testr --slowest --testr-args='{posargs}' passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY [testenv:functional]