pytest-dev / pytest-dev/pytest
Add `package` property to `request`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.5k
- Forks
- 3.4k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 35
Description
What's the problem this feature will solve?
Fixtures can have function, class, and module specific behavior by inspecting request but not package specific behavior, even for package scoped fixtures.
Describe the solution you'd like
Add a package property to FeatureRequest, similar to the current module property, that returns the closest node of type Package.
Alternative Solutions
Current solution would be to have separate fixtures in each package, rather than one fixture with package-specific behavior.
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 at FeatureRequest and inspect the existing module property, then trace how it finds the closest Package node. Add the analogous package behavior and verify it with the relevant fixture/request tests; done means package-scoped fixtures can inspect request.package for package-specific behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100