diff --git a/nova/tests/fixtures.py b/nova/tests/fixtures.py index 2d85197fed40..32b91a8bc9f6 100644 --- a/nova/tests/fixtures.py +++ b/nova/tests/fixtures.py @@ -1067,6 +1067,15 @@ class PoisonFunctions(fixtures.Fixture): def setUp(self): super(PoisonFunctions, self).setUp() + try: + self._poison_libvirt_driver() + except ImportError: + # The libvirt driver uses modules that are not available + # on Windows. + if os.name != 'nt': + raise + + def _poison_libvirt_driver(self): # The nova libvirt driver starts an event thread which only # causes trouble in tests. Make sure that if tests don't # properly patch it the test explodes.