pytest-dev / pytest-dev/pytest
Investigate replacing addfinalizer with ExitStack
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.5k
- Forks
- 3.4k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 35
Description
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 https://github.com/pytest-dev/pytest/pull/5589#issuecomment-510082398
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading pytest's existing addfinalizer implementation and the ExitStack proposal described in the issue. Identify the fixture lifecycle entry points and tests that cover finalizers, then determine whether a per-usage fixture scope is feasible. Done means an agreed design and corresponding implementation and tests, but the issue does not name specific files or test paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100