Skip to content
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

Pickup addition positional args passed to _parse_parametrize_args #5483

Merged
merged 1 commit into from
Jun 25, 2019

Conversation

kevinjfoley
Copy link
Contributor

Fix for #5482.

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.

Thanks! Please also add a CHANGELOG entry and a quick test which shows the problem. 👍

@kevinjfoley
Copy link
Contributor Author

Will do, will also change the arg names which is causing the tests to fail currently.

Any input on where the test should be added?

@nicoddemus
Copy link
Member

I think testing/python/metafunc.py should do it, thanks.

@nicoddemus
Copy link
Member

Hmmm I wonder though, since this is already broken, we should make everything except argnames and argvalues keyword only in 5.0? 🤔

@asottile @blueyed @Zac-HD what do you think?

@nicoddemus
Copy link
Member

(@kevinjfoley perhaps hold on to your patch for a bit, wouldn't want you to waste your time)

@Zac-HD
Copy link
Member

Zac-HD commented Jun 25, 2019

I'm a big fan of keyword-only arguments... but we broke this in 4.6, so I'd prefer to accept the PR (thanks @kevinjfoley!) and then have a follow-up issue to work out what and how to convert to keyword-only arguments.

@codecov
Copy link

codecov bot commented Jun 25, 2019

Codecov Report

Merging #5483 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5483      +/-   ##
==========================================
+ Coverage   96.07%   96.07%   +<.01%     
==========================================
  Files         117      117              
  Lines       25538    25542       +4     
  Branches     2473     2473              
==========================================
+ Hits        24536    24540       +4     
  Misses        698      698              
  Partials      304      304
Impacted Files Coverage Δ
src/_pytest/mark/structures.py 92.57% <ø> (ø) ⬆️
testing/python/metafunc.py 94.92% <100%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f5b078...9571443. Read the comment docs.

@kevinjfoley
Copy link
Contributor Author

thanks @kevinjfoley

No problem!

Pushed a squashed commit with the fix and a test demonstrating the problem, let me know if anything else is needed.

@nicoddemus
Copy link
Member

nicoddemus commented Jun 25, 2019

but we broke this in 4.6, so I'd prefer to accept the PR (thanks @kevinjfoley!) and then have a follow-up issue to work out what and how to convert to keyword-only arguments.

Yeah, I agree, thanks for putting me in check. 😁

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.

Thanks again @kevinjfoley, appreciate it!

@nicoddemus nicoddemus added the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Jun 25, 2019
@nicoddemus nicoddemus merged commit 37fce6c into pytest-dev:master Jun 25, 2019
nicoddemus added a commit to nicoddemus/pytest that referenced this pull request Jun 25, 2019
…est-dev#5483)

Pickup addition positional args passed to _parse_parametrize_args
@kevinjfoley
Copy link
Contributor Author

Thanks again @kevinjfoley, appreciate it!

Happy to be able to contribute!

@asottile
Copy link
Member

Hmmm i don't think this should be merged, it was a bug that parametrize swallowed extra arguments (the test is asserting that a bug exists)

@asottile
Copy link
Member

Oh already merged 🤔

@nicoddemus
Copy link
Member

Hmmm i don't think this should be merged, it was a bug that parametrize swallowed extra arguments (the test is asserting that a bug exists)

Not really, the extra arguments are valid, here's the signature:

def parametrize(self, argnames, argvalues, indirect=False, ids=None, scope=None):

So it is in fact a regression, I'm afraid.

@asottile
Copy link
Member

Yikes, always assumed those were kwargonly, and it's probably too late to do that for 5.0

@nicoddemus
Copy link
Member

I guess we should open an issue then to discuss how to change that so it emits a warning in 5.X so we can turn it into keyword-only in 6.0 at least.

nicoddemus added a commit that referenced this pull request Jun 25, 2019
[4.6] Pickup addition positional args passed to _parse_parametrize_ar… (#5483)
@asottile asottile added backported and removed needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch labels Oct 13, 2019
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.

4 participants