Reset notifier_api before each test.
If tests are not run in the default order nosetests runs them in it is possible that notifier_api in test_notifications.py and test_compute_utils is in a state unsuitable for testing (notifier_api may have had its drivers set elsewhere preventing it from picking up the test driver). Reset the notifier_api before each test to ensure notifier_api is usable for every test run regardless of test order. Part of blueprint grizzly-testtools Change-Id: I1f9282b96e2b2471eb8176b7ce9c95b4b1548ffe
This commit is contained in:
parent
529c89c247
commit
c658a6f73b
@ -215,6 +215,7 @@ class UsageInfoTestCase(test.TestCase):
|
||||
self.stubs.Set(network_api.API, 'get_instance_nw_info',
|
||||
fake_get_nw_info)
|
||||
|
||||
notifier_api._reset_drivers()
|
||||
self.flags(use_local=True, group='conductor')
|
||||
self.flags(compute_driver='nova.virt.fake.FakeDriver',
|
||||
notification_driver=[test_notifier.__name__],
|
||||
|
@ -54,6 +54,7 @@ class NotificationsTestCase(test.TestCase):
|
||||
fake_get_nw_info)
|
||||
fake_network.set_stub_network_methods(self.stubs)
|
||||
|
||||
notifier_api._reset_drivers()
|
||||
self.flags(compute_driver='nova.virt.fake.FakeDriver',
|
||||
notification_driver=[test_notifier.__name__],
|
||||
network_manager='nova.network.manager.FlatManager',
|
||||
|
Loading…
Reference in New Issue
Block a user