pytest-dev / pytest-dev/pytest
pytest could do a better job printing fixture selection info
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?
currently, when one uses a fixture to select between multiple values, say
@pytest.fixture(scope="session", params=[False, True])
def tags(request):
return request.param
it just prints out "True" or "False" when saying what its running.
ala
tests/tests.py::TestClass::test_func[True]
it be nicer if printed something like
tests/tests.py::TestClass::test_func[tags=True]
Describe the solution you'd like
a clearer printout so one doesn't have to dig into the code each time to be reminded what the fixture is.
Alternative Solutions
N/A
Additional context
N/A
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 reproducing the issue with the fixture example using params=[False, True] and observe the collected test IDs. Trace how pytest formats fixture parameter values in the reported test name; done means the output identifies the fixture alongside its value, with tests covering the clearer format.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100