From 4abc8cc64fe9ec2467b8bce56a846aae6fd18ed4 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 30 Oct 2012 16:30:02 -0700 Subject: Use testr to run nova unittests. Convert nova from using nosetests to testr for its test runner. Some tests had to be modified to get them to run properly under testr. run_tests.sh has been updated to run testr instead of nosetests. Coverage is collected by running subunit.run under coverage.py when the coverage environment is selected. Note that you will need to rebuild your virtualenvs as nose is being removed from the dependency lists and is being replaced by testr. Tests will run in different processes once this test is merged so you cannot use test classes to pass information between tests. Each test should be a proper independent unit. Additionally the -x and -d flags to run_tests.sh have been removed as there are currently no decent approximations for those functions. Change-Id: I019ca098972ca749b195f59968cf21edd5ba9109 --- nova/test.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'nova/test.py') diff --git a/nova/test.py b/nova/test.py index 89db4999a..15f0ff122 100644 --- a/nova/test.py +++ b/nova/test.py @@ -191,6 +191,15 @@ class TestCase(testtools.TestCase): self.useFixture(fixtures.NestedTempfile()) self.useFixture(fixtures.TempHomeDir()) + if (os.environ.get('OS_STDOUT_NOCAPTURE') != 'True' and + os.environ.get('OS_STDOUT_NOCAPTURE') != '1'): + stdout = self.useFixture(fixtures.DetailStream('stdout')).stream + self.useFixture(fixtures.MonkeyPatch('sys.stdout', stdout)) + if (os.environ.get('OS_STDERR_NOCAPTURE') != 'True' and + os.environ.get('OS_STDERR_NOCAPTURE') != '1'): + stderr = self.useFixture(fixtures.DetailStream('stderr')).stream + self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr)) + self.log_fixture = self.useFixture(fixtures.FakeLogger('nova')) self.useFixture(conf_fixture.ConfFixture(CONF)) -- cgit