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
This commit is contained in:
Zane Bitter 2013-05-29 09:25:30 +02:00
parent 2e43c2a3ee
commit 9ebf853c5d
1 changed files with 2 additions and 0 deletions

View File

@ -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"