From 40f5e2234acc52617bc2eab5ec98c800e3912eb7 Mon Sep 17 00:00:00 2001 From: "OTSUKA, Yuanying" Date: Thu, 26 Nov 2015 10:58:03 +0900 Subject: [PATCH] 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. Change-Id: I9e3b8c8cb0e6df8f3b67ec9d4fc5bc5d25356d16 Closes-Bug: #1520036 --- tox.ini | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index a7d28c2467..64a1bd72af 100644 --- a/tox.ini +++ b/tox.ini @@ -7,9 +7,12 @@ envlist = py27,py34,pep8 setenv = VIRTUAL_ENV={envdir} usedevelop = True install_command = pip install {opts} {packages} +whitelist_externals = find deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands = python setup.py testr --testr-args='{posargs}' +commands = + find . -type f -name "*.pyc" -delete + python setup.py testr --testr-args='{posargs}' [tox:jenkins] downloadcache = ~/cache/pip