From 9ebf853c5db80e43d94660c37304ef626ea1c69e Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Wed, 29 May 2013 09:25:30 +0200 Subject: [PATCH] Clean up DB migrations when running unit tests When doing development work, all kinds of issue can result when moving between versions of the code that have added/removed DB migration scripts if the compiled .pyc files are left behind. To save the need to do this manually, remove all of the .pyc files when the unit tests are run. Change-Id: Ia4bc889edeeed499e5fc2172d5f7c1b4e693a27b --- run_tests.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/run_tests.sh b/run_tests.sh index d6b09e1f21..63b306e9ec 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -40,6 +40,8 @@ wrapper="" function run_tests { echo 'Running tests' + # Remove any extraneous DB migrations + find heat/db/sqlalchemy/migrate_repo/versions/ -name '*.pyc' -delete # Just run the test suites in current environment if [ -n "$args" ] ; then args="-t $args"