Reduce fixture managing verbosity.
Change-Id: Ibbd35995adc19b0f77364074f00fbdd567983b44
This commit is contained in:
parent
7d0f8e92f4
commit
a9d5eeffc0
@ -97,7 +97,6 @@ def remove_fixture(obj, manager=None):
|
|||||||
def setup_fixture(obj, manager=None):
|
def setup_fixture(obj, manager=None):
|
||||||
'''Get registered fixture and setup it up'''
|
'''Get registered fixture and setup it up'''
|
||||||
fixture = get_fixture(obj, manager=manager)
|
fixture = get_fixture(obj, manager=manager)
|
||||||
LOG.debug('Set up fixture %r', get_fixture_name(fixture))
|
|
||||||
try:
|
try:
|
||||||
fixture.setUp()
|
fixture.setUp()
|
||||||
except testtools.MultipleExceptions as ex:
|
except testtools.MultipleExceptions as ex:
|
||||||
@ -111,7 +110,6 @@ def setup_fixture(obj, manager=None):
|
|||||||
def cleanup_fixture(obj, manager=None):
|
def cleanup_fixture(obj, manager=None):
|
||||||
'''Get registered fixture and clean it up'''
|
'''Get registered fixture and clean it up'''
|
||||||
fixture = get_fixture(obj, manager=manager)
|
fixture = get_fixture(obj, manager=manager)
|
||||||
LOG.debug('Clean up fixture %r', get_fixture_name(fixture))
|
|
||||||
fixture.cleanUp()
|
fixture.cleanUp()
|
||||||
return fixture
|
return fixture
|
||||||
|
|
||||||
@ -344,6 +342,7 @@ class SharedFixture(fixtures.Fixture):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
if not self._setup_executed:
|
if not self._setup_executed:
|
||||||
|
LOG.debug('Set up fixture %r', self.fixture_name)
|
||||||
super(SharedFixture, self).setUp()
|
super(SharedFixture, self).setUp()
|
||||||
self._cleanup_executed = False
|
self._cleanup_executed = False
|
||||||
self._setup_executed = True
|
self._setup_executed = True
|
||||||
@ -351,6 +350,7 @@ class SharedFixture(fixtures.Fixture):
|
|||||||
def cleanUp(self, raise_first=True):
|
def cleanUp(self, raise_first=True):
|
||||||
"""Executes registered cleanups if any"""
|
"""Executes registered cleanups if any"""
|
||||||
if not self._cleanup_executed:
|
if not self._cleanup_executed:
|
||||||
|
LOG.debug('Clean up fixture %r', self.fixture_name)
|
||||||
self.addCleanup(self.cleanup_fixture)
|
self.addCleanup(self.cleanup_fixture)
|
||||||
result = super(SharedFixture, self).cleanUp(raise_first=raise_first)
|
result = super(SharedFixture, self).cleanUp(raise_first=raise_first)
|
||||||
self._setup_executed = False
|
self._setup_executed = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user