Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prioritize outputting relative paths in the terminal #12973

Open
dongfangtianyu opened this issue Nov 18, 2024 · 0 comments
Open

prioritize outputting relative paths in the terminal #12973

dongfangtianyu opened this issue Nov 18, 2024 · 0 comments

Comments

@dongfangtianyu
Copy link
Contributor

What's the problem this feature will solve?

  1. Reduce the occurrence of identical path prefixes in the output.
  2. 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
(terminal)

junitxml
(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

#12911

@dongfangtianyu dongfangtianyu changed the title Prioritize Outputting Relative Paths in the Terminal prioritize outputting relative paths in the terminal Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant