Merge pull request #2914 from nicoddemus/addfinalizer-refactor
Make SubRequest.addfinalizer an explicit method
This commit is contained in:
commit
b671c5a8bf
|
@ -575,7 +575,6 @@ class SubRequest(FixtureRequest):
|
|||
self.param_index = param_index
|
||||
self.scope = scope
|
||||
self._fixturedef = fixturedef
|
||||
self.addfinalizer = fixturedef.addfinalizer
|
||||
self._pyfuncitem = request._pyfuncitem
|
||||
self._fixture_values = request._fixture_values
|
||||
self._fixture_defs = request._fixture_defs
|
||||
|
@ -586,6 +585,9 @@ class SubRequest(FixtureRequest):
|
|||
def __repr__(self):
|
||||
return "<SubRequest %r for %r>" % (self.fixturename, self._pyfuncitem)
|
||||
|
||||
def addfinalizer(self, finalizer):
|
||||
self._fixturedef.addfinalizer(finalizer)
|
||||
|
||||
|
||||
class ScopeMismatchError(Exception):
|
||||
""" A fixture function tries to use a different fixture function which
|
||||
|
|
Loading…
Reference in New Issue