Skip to content

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

Closed

Description

@smarie

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 !

Activity

  1. RonnyPfannschmidt commented on Dec 16, 2020

    @RonnyPfannschmidt
    Member

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

  2. smarie commented on Dec 16, 2020

    @smarie
    ContributorAuthor

    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.

  3. added
    type: questiongeneral question, might be closed after 2 weeks of inactivity
    on Dec 17, 2020
  4. Zac-HD commented on Nov 29, 2021

    @Zac-HD
    Member

    Closing as answered 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: parametrizerelated to @pytest.mark.parametrizetype: questiongeneral question, might be closed after 2 weeks of inactivity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions