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

Slashes in parametrization values get turned into backslashes on Windows #12745

Closed
The-Compiler opened this issue Aug 28, 2024 · 1 comment · Fixed by #12760
Closed

Slashes in parametrization values get turned into backslashes on Windows #12745

The-Compiler opened this issue Aug 28, 2024 · 1 comment · Fixed by #12760
Labels
platform: windows windows platform-specific problem topic: reporting related to terminal output and user-facing messages and errors type: bug problem that needs to be addressed

Comments

@The-Compiler
Copy link
Member

With pytest 8.3.2 as well as the current main, when creating a repro/test_x.py in the pytest repo:

import pytest

@pytest.mark.parametrize("a", ["x/y", "/", "//"])
def test_x(a):
    assert False

and running pytest test_x.py inside repro/, both in the -v output and short test summary, the tests show up as:

test_x.py::test_x[x\y]
test_x.py::test_x[\]
test_x.py::test_x[\]

The IDs show up correctly in --collect-only, and they show correctly when test_x.py is not in a subfolder, or when pytest is not invoked in the subfolder.

@The-Compiler The-Compiler added type: bug problem that needs to be addressed topic: reporting related to terminal output and user-facing messages and errors platform: windows windows platform-specific problem labels Aug 28, 2024
@pytest-dev pytest-dev deleted a comment Aug 28, 2024
@nauman897
Copy link
Contributor

I have attempted to fix this issue in this PR: #12760

The problem only seemed to be with the printing of these IDs

patchback bot pushed a commit that referenced this issue Sep 8, 2024
nicoddemus pushed a commit that referenced this issue Sep 8, 2024
…) (#12787)

Fix #12745

(cherry picked from commit d35b802)

Co-authored-by: Nauman Ahmed <90570675+nauman897@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: windows windows platform-specific problem topic: reporting related to terminal output and user-facing messages and errors type: bug problem that needs to be addressed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants