-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Investigate replacing addfinalizer with ExitStack #5592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
note: ExitStack exposes pop_all any implementation would have to remove such access |
@RonnyPfannschmidt how about exposing request.exit_stack as an instance of:
|
However this is only if there's a usecase for addfinalizer that can't be replaced with a yield fixture using ExitStack |
@graingert i'd like to defer exporting exit stacks until they are a "per fixture request" style/type of fixture if each fixture request has a own exit stack, then its fine if a fixture pops all its things |
@RonnyPfannschmidt did you ever get a chance to read #4871? It is related to how finalizers are handled. |
no, will do now |
addfinalizer can be implemented in terms of adding a callback to a stack
it would be interesting if there was a per usage scope fixture for eexit stacks,
then each fixture could get a very own exit stack in a well expressed manner (and if each fixture had one, it wouldnt be as bad to expose it)
Originally posted by @RonnyPfannschmidt in #5589 (comment)
The text was updated successfully, but these errors were encountered: