fixed examples according to new plugin and setup mechanisms

--HG--
branch : trunk
This commit is contained in:
holger krekel
2009-05-21 14:36:52 +02:00
parent 1b48cbb3c6
commit b8c3f866b5
4 changed files with 16 additions and 24 deletions

View File

@@ -1,16 +1,10 @@
class ConftestPlugin:
def pytest_configure(self, config):
self._setup = None
def pytest_funcarg__setup(self, request):
if self._setup is None:
self._setup = CostlySetup()
return self._setup
def pytest_unconfigure(self, config):
if self._setup is not None:
self._setup.finalize()
def pytest_funcarg__setup(request):
return request.cached_setup(
setup=lambda: CostlySetup(),
teardown=lambda costlysetup: costlysetup.finalize(),
scope="session",
)
class CostlySetup:
def __init__(self):