From 37a51f83e63a7c1ec9ceb75e70bb759592495fcc Mon Sep 17 00:00:00 2001 From: Chris Behrens Date: Wed, 3 Aug 2011 10:11:20 -0700 Subject: [PATCH] more cleanup of API tests regarding FLAGS --- nova/test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nova/test.py b/nova/test.py index 549aa6fcf..804dc8c37 100644 --- a/nova/test.py +++ b/nova/test.py @@ -100,6 +100,7 @@ class TestCase(unittest.TestCase): self.injected = [] self._services = [] self._original_flags = FLAGS.FlagValuesDict() + self._original_flags_verbosity = FLAGS.verbose def tearDown(self): """Runs after each test method to tear down test environment.""" @@ -157,6 +158,11 @@ class TestCase(unittest.TestCase): FLAGS.Reset() for k, v in self._original_flags.iteritems(): setattr(FLAGS, k, v) + FLAGS.verbose = self._original_flags_verbosity + + def set_flags_verbosity(self, verbose=True): + """Set the FLAGS verbosity for a test""" + FLAGS.verbose = verbose def start_service(self, name, host=None, **kwargs): host = host and host or uuid.uuid4().hex