Skip to content

Ini option aliases #13829

Closed

Description

@bluetech

For #13823 I'd like strictness options to have a consistent strict_foo naming scheme, however the option xfail_strict has it in reverse. I'd like to rename it to strict_xfail, while keeping xfail_strict as an alias.

To achieve this cleanly, I propose we add support for aliases to parser.addini(). It's pretty useful functionality for backward compatibility, and plugins may want to use it as well.

Activity

  1. self-assigned this
    on Oct 19, 2025
  2. added theissue type on Oct 19, 2025
  3. added
    type: enhancementnew feature or API change, should be merged into features branch
    type: proposalproposal for a new feature, often to gather opinions or design the API around the new feature
    topic: configrelated to config handling, argument parsing and config file
    on Oct 19, 2025
  4. added 2 commits that reference this issue on Oct 19, 2025
    5534eff
    de5d649
  5. The-Compiler commented on Oct 20, 2025

    @The-Compiler
    Member

    Not sure if I like the additional churn after we already had multiple iterations of strict options changed (even with an alias, it gets confusing if people see/use different things to do the same thing).

    Note how --strict and --strict-* are currently CLI options, but xfail_strict = True is an ini option. IMHO naming consistency between the two isn't important, because they're two different things, and already inconsistent anyways.

    If anything, IMHO we should have strict / strict_markers / strict_config / strict_xfail as ini options (see #13823 (comment)) rather than CLI flags, and then it makes sense to make the naming consistent. But if we go there, please let's do it in one step instead of doing the xfail_strict rename/alias in one release and the CLI -> INI move of the rest in another.

    If we end up with aliasing options, IMHO there's a discussion to be had whether to deprecate the old way. Yes, it causes churn, but so does having two ways to do the same thing (especially for newcomers which might see both in different tutorials, and then they also need to know about which pytest version they use, etc.).

  6. bluetech commented on Oct 21, 2025

    @bluetech
    MemberAuthor

    @The-Compiler this issue is about ini option aliases, just to make sure, do you have an objection to the feature itself?

    I'll reply to the rest of the comment in #13823 to keep the discussion about strict in one place.

  7. added 2 commits that reference this issue on Oct 21, 2025
    5c75785
    355ff09
  8. added a commit that references this issue on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

topic: configrelated to config handling, argument parsing and config filetype: enhancementnew feature or API change, should be merged into features branchtype: proposalproposal for a new feature, often to gather opinions or design the API around the new feature

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions