pytest-dev / pytest-dev/pytest
Make tmp_path truncation configurable or longer
Open
Nobody has claimed this yet.
plugin: tmpdir
topic: config
- 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 the tmp_path is truncated to 30 chars. For longer test names this removes the _<run> from the tmp_path. which is inconvenient
Describe the solution you'd like
Make this truncation length configurable or increase the max lenght (255 for example).
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 in src/_pytest/tmpdir.py around line 255 and inspect how tmp_path names are truncated. Decide whether the limit should be configurable or increased, then verify with tests that long test names retain the _ suffix and that the resulting path behavior matches the chosen limit.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100