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

pytest.param() is not documented #2658

Closed
hynek opened this issue Aug 5, 2017 · 7 comments
Closed

pytest.param() is not documented #2658

hynek opened this issue Aug 5, 2017 · 7 comments
Assignees
Labels

Comments

@hynek
Copy link
Contributor

@hynek hynek commented Aug 5, 2017

I’ve learned about pytest.param by accident and I’m still not sure what it’s for. It’s used offhand in some examples, but there’s neither any narrative docs nor does it appear in https://docs.pytest.org/en/latest/builtin.html .

Pls fix. :)

@nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Aug 6, 2017

Thanks @hynek!

@Jdsleppy
Copy link

@Jdsleppy Jdsleppy commented Oct 17, 2017

I'm afraid it doesn't do much and looks to only be a shorthand for another undocumented method:

https://github.com/pytest-dev/pytest/blob/master/_pytest/mark.py#L80

I'm not very familiar with the pytest codebase, but it doesn't seem like it's built for external use.

@The-Compiler
Copy link
Member

@The-Compiler The-Compiler commented Oct 17, 2017

It is intended for public use, to apply markers in pytest.mark.parametrize or set test IDs easily - i.e. something like pytest.param('foo', marks=pytest.mark.skipif(...)) (instead of the earlier confusing pytest.mark.skipif(...)('foo')), and pytest.param('foo', id='bar') (instead of having the ID in a list disconnected from the parameters).

@rlaverde
Copy link

@rlaverde rlaverde commented Oct 22, 2017

Hi, I just found a little example of it in the documentation (in the second code example of this parametrize section)

Should It be extended? Maybe a new section in the same doc page (parametrize)?

@nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Oct 22, 2017

@rlaverde definitely, including a full specification of the parameters would be nice as well.

@dawranliou
Copy link
Contributor

@dawranliou dawranliou commented Oct 28, 2017

Hi everyone! I'm a new contributor to Pytest. Based on the discussion above I submitted PR #2881 addressing this issue. Could you help me review the PR? Any suggestion is welcome. Thank you!

@dawranliou dawranliou mentioned this issue Oct 28, 2017
4 of 4 tasks complete
@nicoddemus
Copy link
Member

@nicoddemus nicoddemus commented Nov 3, 2017

Closed by #2881

@nicoddemus nicoddemus closed this Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants