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

Comments

Projects
None yet
4 participants
@GeorgeFischhof

GeorgeFischhof commented Dec 5, 2017

[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

This comment has been minimized.

Member

RonnyPfannschmidt commented Dec 5, 2017

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

@stsatlantis

This comment has been minimized.

stsatlantis commented Jan 8, 2018

Should be this one resolved?

@nicoddemus

This comment has been minimized.

Member

nicoddemus commented Jan 8, 2018

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