Override fixture context methods with setup/cleanup functions
Change-Id: I68028cd86a6d065be3e2be4530d0632d46789e9d
This commit is contained in:
@@ -379,6 +379,13 @@ class SharedFixture(fixtures.Fixture):
|
||||
self._cleanup_executed = True
|
||||
return result
|
||||
|
||||
def __enter__(self):
|
||||
return setup_fixture(self)
|
||||
|
||||
def __exit__(self, exc_type, exc_val, exc_tb): # noqa
|
||||
cleanup_fixture(self)
|
||||
return False # propagate exceptions from the with body.
|
||||
|
||||
def _setUp(self):
|
||||
self.setup_fixture()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user