From bcaff21f07763e9dbd859ea81f72cbca83a6e113 Mon Sep 17 00:00:00 2001 From: Brant Knudson Date: Thu, 8 Jan 2015 14:39:45 -0600 Subject: Move WarningsFixture after DatabaseFixture so emit once The DatabaseFixture must be messing with the warnings module. Change-Id: Ic8b22569a4a8fb05b4d875e34432ada97a52f10c Partial-Bug: #1407736 --- nova/test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'nova/test.py') diff --git a/nova/test.py b/nova/test.py index b1cea61166..81c919ffc4 100644 --- a/nova/test.py +++ b/nova/test.py @@ -198,7 +198,6 @@ class TestCase(testtools.TestCase): self.useFixture(nova_fixtures.OutputStreamCapture()) self.useFixture(nova_fixtures.StandardLogging()) - self.useFixture(nova_fixtures.WarningsFixture()) # NOTE(sdague): because of the way we were using the lock # wrapper we eneded up with a lot of tests that started @@ -224,6 +223,10 @@ class TestCase(testtools.TestCase): if self.USES_DB: self.useFixture(nova_fixtures.Database()) + # NOTE(blk-u): WarningsFixture must be after the Database fixture + # because sqlalchemy-migrate messes with the warnings filters. + self.useFixture(nova_fixtures.WarningsFixture()) + # NOTE(danms): Make sure to reset us back to non-remote objects # for each test to avoid interactions. Also, backup the object # registry. -- cgit v1.2.1