From a59e28bbd03a79e3266bb8960fba8a91bd48578e Mon Sep 17 00:00:00 2001 From: Andy Smith Date: Tue, 18 Jan 2011 17:32:54 -0800 Subject: [PATCH] move db sync into nosetests package-level fixtures so that the existing nosetests attempt in hudson will pass --- nova/tests/__init__.py | 5 +++++ run_tests.py | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/nova/tests/__init__.py b/nova/tests/__init__.py index 8dc87d0e2..592d5bea9 100644 --- a/nova/tests/__init__.py +++ b/nova/tests/__init__.py @@ -34,3 +34,8 @@ # The code below enables nosetests to work with i18n _() blocks import __builtin__ setattr(__builtin__, '_', lambda x: x) + + +def setup(): + from nova.db import migration + migration.db_sync() diff --git a/run_tests.py b/run_tests.py index fbca3cbe3..7b5e2192a 100644 --- a/run_tests.py +++ b/run_tests.py @@ -26,10 +26,6 @@ from nose import config from nose import result from nose import core -gettext.install('nova', unicode=1) - -from nova.db import migration - class NovaTestResult(result.TextTestResult): def __init__(self, *args, **kw): @@ -65,9 +61,6 @@ if __name__ == '__main__': c = config.Config(stream=sys.stdout, env=os.environ, verbosity=3) - - migration.db_sync() - runner = NovaTestRunner(stream=c.stream, verbosity=c.verbosity,