Merge "Fix driver tests on Windows"

This commit is contained in:
Zuul 2019-11-19 20:47:34 +00:00 committed by Gerrit Code Review
commit 889f524660
1 changed files with 9 additions and 0 deletions

View File

@ -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.