fixtures: change a lambda to partial
It makes for a more debuggable repr. Before: <function FixtureRequest._schedule_finalizers.<locals>.<lambda> at 0x7fe4ae32d440> After: functools.partial(<bound method FixtureDef.finish of <FixtureDef argname='hello_package' scope='package' baseid=''>>, request=<SubRequest 'hello_package' for <Function test_hello>>)
This commit is contained in:
parent
b20e7f6d0c
commit
7967b2e710
|
@ -698,7 +698,8 @@ class FixtureRequest:
|
|||
self, fixturedef: "FixtureDef[object]", subrequest: "SubRequest"
|
||||
) -> None:
|
||||
# If fixture function failed it might have registered finalizers.
|
||||
subrequest.node.addfinalizer(lambda: fixturedef.finish(request=subrequest))
|
||||
finalizer = functools.partial(fixturedef.finish, request=subrequest)
|
||||
subrequest.node.addfinalizer(finalizer)
|
||||
|
||||
def _check_scope(
|
||||
self,
|
||||
|
|
Loading…
Reference in New Issue