Skip to content

Remove support for applying marks to values in parametrize #4571

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

Merged
merged 1 commit into from
Dec 21, 2018

Conversation

nicoddemus
Copy link
Member

Fix #3082

"equal to the number of names ({})".format(
param.values, argnames
)
msg = (
Copy link
Member Author

Choose a reason for hiding this comment

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

Improved this message, it now looks like this:

_________________________________________ ERROR collecting test-param-mark.py _________________________________________
test-param-mark.py::test_increment: in "parametrize" the number of names (2):
  ('n', 'expected')
must be equal to the number of values (3):
  (1, 2, 4)

@@ -82,39 +81,23 @@ def param(cls, *values, **kw):
return cls(values, marks, id_)

@classmethod
def extract_from(cls, parameterset, belonging_definition, legacy_force_tuple=False):
def extract_from(cls, parameterset, force_tuple=False):
Copy link
Member

Choose a reason for hiding this comment

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

that parameter name shouldnt be changed
also taking away belonging definition is a breaking change

Copy link
Member Author

@nicoddemus nicoddemus Dec 20, 2018

Choose a reason for hiding this comment

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

Hmmm ParameterSet is not public API and is not exposed in the pytest. namespace, so I don't think this is a breaking change.

About the parameter name I renamed it because I don't understand why it was named legacy, it seems like it is part of the normal workflow...

Copy link
Member

Choose a reason for hiding this comment

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

actually right, that one is a internal one, we should make it a normal function, so its not accidentially exposed on instances

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good point, but I think that's not even necessary because one can't even access a ParameterSet instance, even from hooks (I think).

Copy link
Member

Choose a reason for hiding this comment

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

@nicoddemus its exposed as return value of pytest.param

@codecov
Copy link

codecov bot commented Dec 20, 2018

Codecov Report

Merging #4571 into features will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##           features    #4571      +/-   ##
============================================
- Coverage     95.74%   95.73%   -0.02%     
============================================
  Files           111      111              
  Lines         24888    24863      -25     
  Branches       2452     2449       -3     
============================================
- Hits          23829    23802      -27     
- Misses          746      749       +3     
+ Partials        313      312       -1
Flag Coverage Δ
#docs 29.41% <40%> (+0.08%) ⬆️
#doctesting 29.41% <40%> (+0.08%) ⬆️
#linting 29.41% <40%> (+0.08%) ⬆️
#linux 95.56% <100%> (-0.01%) ⬇️
#nobyte 92.39% <100%> (-0.04%) ⬇️
#numpy 93.17% <100%> (-0.05%) ⬇️
#pexpect 41.87% <60%> (+0.02%) ⬆️
#py27 93.78% <100%> (-0.02%) ⬇️
#py34 91.88% <100%> (+0.04%) ⬆️
#py35 91.9% <100%> (+0.04%) ⬆️
#py36 91.92% <100%> (+0.04%) ⬆️
#py37 93.92% <100%> (-0.01%) ⬇️
#trial 93.17% <100%> (-0.05%) ⬇️
#windows 93.93% <100%> (-0.04%) ⬇️
#xdist 93.78% <100%> (-0.03%) ⬇️
Impacted Files Coverage Δ
testing/test_mark.py 97.19% <ø> (-0.07%) ⬇️
src/_pytest/deprecated.py 100% <ø> (ø) ⬆️
testing/python/metafunc.py 95.21% <ø> (-0.57%) ⬇️
testing/python/collect.py 99.36% <100%> (-0.01%) ⬇️
src/_pytest/mark/structures.py 94.03% <100%> (-0.71%) ⬇️
src/_pytest/cacheprovider.py 95.75% <0%> (-1.42%) ⬇️
src/_pytest/terminal.py 91.7% <0%> (+0.84%) ⬆️

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 d888d5c...c378cb4. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Dec 20, 2018

Codecov Report

Merging #4571 into features will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##           features    #4571      +/-   ##
============================================
- Coverage     95.74%   95.73%   -0.02%     
============================================
  Files           111      111              
  Lines         24888    24863      -25     
  Branches       2452     2449       -3     
============================================
- Hits          23829    23802      -27     
- Misses          746      749       +3     
+ Partials        313      312       -1
Flag Coverage Δ
#docs 29.41% <40%> (+0.08%) ⬆️
#doctesting 29.41% <40%> (+0.08%) ⬆️
#linting 29.41% <40%> (+0.08%) ⬆️
#linux 95.56% <100%> (-0.01%) ⬇️
#nobyte 92.39% <100%> (-0.04%) ⬇️
#numpy 93.17% <100%> (-0.05%) ⬇️
#pexpect 41.87% <60%> (+0.02%) ⬆️
#py27 93.78% <100%> (-0.02%) ⬇️
#py34 91.88% <100%> (+0.04%) ⬆️
#py35 91.9% <100%> (+0.04%) ⬆️
#py36 91.92% <100%> (+0.04%) ⬆️
#py37 93.92% <100%> (-0.01%) ⬇️
#trial 93.17% <100%> (-0.05%) ⬇️
#windows 93.93% <100%> (-0.04%) ⬇️
#xdist 93.78% <100%> (-0.03%) ⬇️
Impacted Files Coverage Δ
testing/test_mark.py 97.19% <ø> (-0.07%) ⬇️
src/_pytest/deprecated.py 100% <ø> (ø) ⬆️
testing/python/metafunc.py 95.21% <ø> (-0.57%) ⬇️
testing/python/collect.py 99.36% <100%> (-0.01%) ⬇️
src/_pytest/mark/structures.py 94.03% <100%> (-0.71%) ⬇️
src/_pytest/cacheprovider.py 95.75% <0%> (-1.42%) ⬇️
src/_pytest/terminal.py 91.7% <0%> (+0.84%) ⬆️

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 d888d5c...c378cb4. Read the comment docs.

@nicoddemus nicoddemus merged commit 58fc918 into pytest-dev:features Dec 21, 2018
@nicoddemus nicoddemus deleted the remove-parametrize-marks branch December 21, 2018 10:24
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.

2 participants