pytest-dev / pytest-dev/pytest
prioritize outputting relative paths in the terminal
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?
- Reduce the occurrence of identical path prefixes in the output.
- Minimize platform-dependent differences in output.
Describe the solution you'd like
Use Cases:
import pytest
@pytest.mark.skip("balabala")
def test_skip():
pass
@pytest.mark.unknown_mark
def test_pass():
pass
def test_fixture(miss_setup):
print('hi there')
Execution:
pytest --junit-xml=junit.xml
Output: (Expected: Remove the absolute paths highlighted in green.)
(terminal)
(junitxml)
Alternative Solutions
No configuration or plugin solution has been found yet.
Try to add a 'cwd_relative_path' method and call it before the output path to convert the absolute path to a relative path
Additional context
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 shown tests with pytest --junit-xml=junit.xml and compare the terminal and JUnit XML paths with the expected relative output. Trace where those two outputs format paths; done means the repeated absolute prefixes are removed consistently without a configuration or plugin.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100