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

Comments

Projects
None yet
7 participants
@hynek
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

This comment has been minimized.

Member

nicoddemus commented Aug 6, 2017

Thanks @hynek!

@Jdsleppy

This comment has been minimized.

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

This comment has been minimized.

Member

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

This comment has been minimized.

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

This comment has been minimized.

Member

nicoddemus commented Oct 22, 2017

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

@dawran6

This comment has been minimized.

Contributor

dawran6 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!

@dawran6 dawran6 referenced this issue Oct 28, 2017

Merged

Document pytest.param #2881

4 of 4 tasks complete
@nicoddemus

This comment has been minimized.

Member

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