diff options
author | Balazs Gibizer <balazs.gibizer@est.tech> | 2020-10-15 12:47:36 +0200 |
---|---|---|
committer | Stephen Finucane <stephenfin@redhat.com> | 2021-05-24 11:00:59 +0100 |
commit | f1f599d098c2dcb307bfab074060855c703a8288 (patch) | |
tree | 3e61a01df9c856608ec05202c0ed3bcefff0843b /nova/tests/unit/objects | |
parent | 696fbab9e1a96841b0acd1d5530b59e4c7878c00 (diff) | |
download | nova-f1f599d098c2dcb307bfab074060855c703a8288.tar.gz |
Create a fixture around fake_notifier
The fake_notifier uses module globals and also needs careful stub and
reset calls to work properly. This patch wraps the fake_notifier into a
proper Fixture that automates the complexity.
This is fairly rage patch but it does not change any logic just redirect
calls from the fake_notifier to the new NotificationFixture
Change-Id: I456f685f480b8de71014cf232a8f08c731605ad8
Diffstat (limited to 'nova/tests/unit/objects')
-rw-r--r-- | nova/tests/unit/objects/test_objects.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/nova/tests/unit/objects/test_objects.py b/nova/tests/unit/objects/test_objects.py index b2f4f0616d..2efc19cab5 100644 --- a/nova/tests/unit/objects/test_objects.py +++ b/nova/tests/unit/objects/test_objects.py @@ -34,7 +34,6 @@ from nova.objects import fields from nova.objects import virt_device_metadata from nova import test from nova.tests import fixtures as nova_fixtures -from nova.tests.unit import fake_notifier from nova import utils @@ -211,8 +210,7 @@ class _BaseTestCase(test.TestCase): self.user_id = 'fake-user' self.project_id = 'fake-project' self.context = context.RequestContext(self.user_id, self.project_id) - fake_notifier.stub_notifier(self) - self.addCleanup(fake_notifier.reset) + self.useFixture(nova_fixtures.NotificationFixture(self)) # NOTE(danms): register these here instead of at import time # so that they're not always present |