Skip to content

Conversation

@RonnyPfannschmidt
Copy link
Member

this ensures we dont invoke idfunc with the internal NOTSET enum token

closes #13031

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Dec 17, 2024
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the ronny/fix-13031-parametrize-empty-concrete-id branch from c87c874 to da7251c Compare December 18, 2024 12:56
@@ -0,0 +1,2 @@
``pytest.mark.parametrize([], isfunc=...)`` will no longer call the idfunc with the internal ``NOTSET``
Copy link
Member

@nicoddemus nicoddemus Dec 18, 2024

Choose a reason for hiding this comment

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

isfunc? Is that correct?

Also can you rewrite this from the POV of an user? I mean the description by itself is hard to understand without reading the associated issue first.

Comment on lines 1058 to 1059
def idfunc(value):
raise ValueError()
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def idfunc(value):
raise ValueError()
def idfunc(value):
raise ValueError()

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

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

I think we just need to update the changelog as commented and we're good to go. 👍

@RonnyPfannschmidt RonnyPfannschmidt force-pushed the ronny/fix-13031-parametrize-empty-concrete-id branch from da7251c to 38be67a Compare December 21, 2024 09:40
…ter list stand-in

this ensures we dont invoke idfunc with the internal NOTSET enum token
@RonnyPfannschmidt RonnyPfannschmidt force-pushed the ronny/fix-13031-parametrize-empty-concrete-id branch from 38be67a to 4dcbbcb Compare December 21, 2024 09:41
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
@RonnyPfannschmidt RonnyPfannschmidt enabled auto-merge (squash) December 21, 2024 13:02
@RonnyPfannschmidt RonnyPfannschmidt merged commit 7d585ac into pytest-dev:main Dec 21, 2024
28 checks passed
@patchback
Copy link

patchback bot commented Dec 21, 2024

Backport to 8.3.x: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 7d585ac on top of patchback/backports/8.3.x/7d585acd1123a6bf6df6ff3279757bb5a69a9417/pr-13073

Backporting merged PR #13073 into main

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/pytest-dev/pytest.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/8.3.x/7d585acd1123a6bf6df6ff3279757bb5a69a9417/pr-13073 upstream/8.3.x
  4. Now, cherry-pick PR fix #13031: use the concrete id NOTSET for the empty parameter list #13073 contents into that branch:
    $ git cherry-pick -x 7d585acd1123a6bf6df6ff3279757bb5a69a9417
    If it'll yell at you with something like fatal: Commit 7d585acd1123a6bf6df6ff3279757bb5a69a9417 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x 7d585acd1123a6bf6df6ff3279757bb5a69a9417
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR fix #13031: use the concrete id NOTSET for the empty parameter list #13073 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/8.3.x/7d585acd1123a6bf6df6ff3279757bb5a69a9417/pr-13073
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

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

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parametrizing a test with an empty list calls ids callback with the private constant NOTSET

3 participants