From 238b890d9ba2c828bb2a02e7e295acd63d9ec3dd Mon Sep 17 00:00:00 2001 From: holger krekel Date: Thu, 21 Nov 2013 12:42:22 +0100 Subject: [PATCH] avoid maintaining a fixturestack --- _pytest/python.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/_pytest/python.py b/_pytest/python.py index d1287d92e..d88295af1 100644 --- a/_pytest/python.py +++ b/_pytest/python.py @@ -1298,8 +1298,7 @@ class FixtureRequest(FuncargnamesCompatAttr): else: scope = self.scope - subrequest = SubRequest(self, argname, scope, param, - fixturedef.addfinalizer) + subrequest = SubRequest(self, scope, param, fixturedef) try: # perform the fixture call val = fixturedef.execute(request=subrequest) @@ -1349,13 +1348,13 @@ notset = object() class SubRequest(FixtureRequest): """ a sub request for handling getting a fixture from a test function/fixture. """ - def __init__(self, request, argname, scope, param, addfinalizer): + def __init__(self, request, scope, param, fixturedef): self._parent_request = request - self.fixturename = argname + self.fixturename = fixturedef.argname if param is not notset: self.param = param self.scope = scope - self.addfinalizer = addfinalizer + self.addfinalizer = fixturedef.addfinalizer self._pyfuncitem = request._pyfuncitem self._funcargs = request._funcargs self._arg2fixturedefs = request._arg2fixturedefs