Skip to content

fix #6881 - add policies for too long ids from a str and use short as default #13370

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RonnyPfannschmidt
Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt commented Apr 11, 2025

this experiments with addign a policy and a new default

  • short(default) - if the str is longer than 100, use the normal shorten
  • hash: make a sha256 of the value
  • legacy: just take the long str, for transitons
  • disallow: juexpect people to pick ids

closes #6881

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

src/_pytest/python.py:114

  • Typo 'parameer' should be 'parameter', and the help text mentions 'sha3' while the code uses hashlib.sha256. Please update for consistency.
        help="strategy for parameer values that result in long ids\n- short: default: shorten the value normally\n- hash: take a sha3 of the value for content matching ids\n- legacy: keep the long id (only use this for temporary backward compatibility)\n- disallow: fail and request explicit ids",

testing/python/metafunc.py:666

  • [nitpick] The expected output for the 'short' strategy ('a0') when the input string is long is non-obvious. Please add a comment to clarify the rationale for this expected value.
            "short": "a0",

@RonnyPfannschmidt RonnyPfannschmidt changed the title y fix #6881 - add policies for too long ids from a str and use short as default Apr 11, 2025
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

Successfully merging this pull request may close these issues.

Long parametrized test_input on Windows: ValueError: the environment variable is longer than 32767 characters
1 participant