Skip to content

Is slash / a reliable character to indicate a fixture union alternative test id in pytest-cases #8157

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

Closed
smarie opened this issue Dec 16, 2020 · 3 comments
Labels
topic: parametrize related to @pytest.mark.parametrize type: question general question, might be closed after 2 weeks of inactivity

Comments

@smarie
Copy link
Contributor

smarie commented Dec 16, 2020

Dear pytest maintainers, in pytest-cases as you know I extend the "cross-product" parametrization engine of pytest so that it becomes a tree of independent cross-products, each path in the tree being a combination of fixture alternatives and having its own fixture closure. (see more detailed explanation here)

I recently was challenged by users to simplify the generated test ids. I think that I found a reasonably elegant solution. It relies on a special character indicating that a given parameterset is a fixture alternative. For now I use special character /, as I find it intuitive to indicate that this goes into a sub-branch of the fixture closure tree.

However I just noticed that this character is transformed by pytest into a backslash \ for display. Is this the only side-effect or is there any other I should know about ?

Thanks a lot for your feedback !

@RonnyPfannschmidt
Copy link
Member

Off hand I'd think it's just path display bug, i intend to turn test ids into a more complex object soonish

@smarie
Copy link
Contributor Author

smarie commented Dec 16, 2020

Thanks @RonnyPfannschmidt . Ok, then I'll release version 2.8.0 with this character, and if this becomes a forbidden character let me know! Of course if the display can be fixed in the future that can be even better, but this is non-blocking for me. The only side-effet of current behaviour for users of pytest-harvest or similar plugin is that they see / in the list of collected the test results, but see \ in the console display and IDE (PyCharm, etc.). Not a big deal I guess.

@Zac-HD Zac-HD added topic: parametrize related to @pytest.mark.parametrize type: question general question, might be closed after 2 weeks of inactivity labels Dec 17, 2020
@Zac-HD
Copy link
Member

Zac-HD commented Nov 29, 2021

Closing as answered 👍

@Zac-HD Zac-HD closed this as completed Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: parametrize related to @pytest.mark.parametrize type: question general question, might be closed after 2 weeks of inactivity
Projects
None yet
Development

No branches or pull requests

3 participants