pytest-dev / pytest-dev/pytest
Extra Documentation For Importing Session Scoped Fixtures From A File
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?
@RonnyPfannschmidt confirmed that issue #3217 is a feature, not a bug. This however created hours of confusion for me as it led to test-breaking exceptions that could not be explained by the relevant pytest docs.
Describe the solution you'd like
A Python warning explaining this behaviour when manually importing session-scoped fixtures would have allowed this problem to be instantly debugged.
Alternative Solutions
Adding a warning to the aforementioned docs / the docstring of the pytest fixture scope attribute.
Additional context
Love the library. Just looking out for the next person.
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 issue #3217 and the linked pytest fixture-scope documentation, focusing on manually importing session-scoped fixtures from a file. Decide whether the behavior is best addressed with a Python warning or clearer documentation, then verify that the confusing exception scenario is explained or produces the intended warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100