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

Parametrize error when passing positional args #5482

Closed
kevinjfoley opened this issue Jun 24, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@kevinjfoley
Copy link
Contributor

commented Jun 24, 2019

Starting with 4.6.0, when passing anything but argnames and argvalues to pytest.mark.parametrize as position arguments, pytest fails during collection with

_pytest/fixtures.py:1145: in _get_direct_parametrize_args
    *marker.args, **marker.kwargs
E TypeError: _parse_parametrize_args() takes exactly 2 arguments (4 given)

a minimal example:

import pytest
@pytest.mark.parametrize(["a", "b"], [(1, 2), (3, 4)], False, ["1", "2"])
def test_t_pos(a, b):
    assert a + 1 == b

I believe the issue stems from this PR - #5254. The new _parse_parametrize_args method only takes argnames and argvalues as positional arguments and expects all additional arguments to be keywords.

@nicoddemus

This comment has been minimized.

Copy link
Member

commented Jun 25, 2019

Fixed by #5483

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.