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

[Doc] Parametrize matrix order appers inverted in doc #3001

Closed
GeorgeFischhof opened this issue Dec 5, 2017 · 3 comments
Closed

[Doc] Parametrize matrix order appers inverted in doc #3001

GeorgeFischhof opened this issue Dec 5, 2017 · 3 comments
Labels
good first issue easy issue that is friendly to new contributor status: help wanted developers would like help from experts on this topic type: docs documentation improvement, missing or needing clarification

Comments

@GeorgeFischhof
Copy link

[Doc] Parametrize matrix order appers inverted in doc

Hi there,

the page on the following url (and maybe other parts are affected too):
https://docs.pytest.org/en/latest/parametrize.html
says :

import pytest
@pytest.mark.parametrize("x", [0, 1])
@pytest.mark.parametrize("y", [2, 3])
def test_foo(x, y):
    pass
This will run the test with the arguments set to x=0/y=2, x=0/y=3, x=1/y=2 and x=1/y=3

But the inner and outer cycles are in reverse order; the actual and expected result is:

test_foo[2-0]
test_foo[2-1]
test_foo[3-0]
test_foo[3-1]

Used:
Python 3.6.1
latest pytest
windows 7

BR,
George

@RonnyPfannschmidt
Copy link
Member

good find, due to how python decorators work, declaration order and application order are reversed and we should make a note of that

@RonnyPfannschmidt RonnyPfannschmidt added good first issue easy issue that is friendly to new contributor status: help wanted developers would like help from experts on this topic type: docs documentation improvement, missing or needing clarification labels Dec 5, 2017
@stsatlantis
Copy link

Should be this one resolved?

@nicoddemus
Copy link
Member

Yes, thanks for the ping! Fixed by #3043

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue easy issue that is friendly to new contributor status: help wanted developers would like help from experts on this topic type: docs documentation improvement, missing or needing clarification
Projects
None yet
Development

No branches or pull requests

4 participants