# HG changeset patch # User Andrey Skvortsov # Date 1538734288 -10800 # Node ID 925adaa2cd5c56a42682da96a50c630da9baa6f3 # Parent 07f48018b6f5e0f8db3680e3e18cdd40c194594b cleanup pyc files between running pytest this is need to avoid problem sometimes tests are run inside docker container and sometimes local. Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/_pytest/config/__init__.py", line 409, in _importconftest mod = conftestpath.pyimport() File "/usr/lib/python2.7/dist-packages/py/_path/local.py", line 686, in pyimport raise self.ImportMismatchError(modname, modfile, self) ImportMismatchError: ('conftest', '/beremiz/tests/tools/conftest.py', local('/home/developer/beremiz/tests/tools/conftest.py')) ERROR: could not load /home/developer/beremiz/tests/tools/conftest.py diff -r 07f48018b6f5 -r 925adaa2cd5c tests/tools/run_python_tests.sh --- a/tests/tools/run_python_tests.sh Thu Oct 04 17:24:40 2018 +0300 +++ b/tests/tools/run_python_tests.sh Fri Oct 05 13:11:28 2018 +0300 @@ -1,17 +1,28 @@ #!/bin/sh +cleanup() +{ + find ./tests/tools -name '*.pyc' -delete +} + LC_ALL=ru_RU.utf-8 export DISPLAY=:42 Xvfb $DISPLAY -screen 0 1280x1024x24 & sleep 1 + +cleanup + ret=0 DELAY=400 KILL_DELAY=$(($DELAY + 30)) timeout -k $KILL_DELAY $DELAY pytest --timeout=10 ./tests/tools ret=$? +cleanup + + pkill -9 Xvfb exit $ret