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
type: docs documentation improvement, missing or needing clarification

Comments

@hynek
Copy link
Contributor

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 nicoddemus added the type: docs documentation improvement, missing or needing clarification label Aug 6, 2017
@nicoddemus
Copy link
Member

Thanks @hynek!

@Jdsleppy
Copy link

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

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

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

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

@dawranliou
Copy link
Contributor

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 tasks
@nicoddemus
Copy link
Member

Closed by #2881

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: docs documentation improvement, missing or needing clarification
Projects
None yet
Development

No branches or pull requests

7 participants