diff --git a/tobiko/common/_fixture.py b/tobiko/common/_fixture.py index a2a72409b..1ccbd547e 100644 --- a/tobiko/common/_fixture.py +++ b/tobiko/common/_fixture.py @@ -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()