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

Missing param attribute on request if one param name is substring of other #745

Closed
pytestbot opened this issue May 19, 2015 · 3 comments
Closed
Labels
type: bug problem that needs to be addressed

Comments

@pytestbot
Copy link
Contributor

Originally reported by: Markus Unterwaditzer (BitBucket: untitaker, GitHub: untitaker)


This is kind-of related to #460, except that it doesn't seem to have anything to do with chained/nested fixtures. Instead, the following testsuite fails because the item_types parameter contains item_type, which is the name of another fixture!

Renaming item_types to something else which doesn't contain item_type as substring fixes the issue, as does modifying item_types to become a fixture.

#!python

import pytest

@pytest.fixture(params=list(range(3)))
def item_type(request):
    return request.param


@pytest.mark.parametrize('item_types', list(range(3)))
def test_simple(item_type, item_types):
    pass

@pytestbot pytestbot added the type: bug problem that needs to be addressed label Jun 15, 2015
@jgiralt
Copy link

jgiralt commented Jul 16, 2015

Looks the same as #736

@untitaker
Copy link
Contributor

Indeed it is. I would close it but can't.

Sent from my phone. Please excuse my brevity.

@nicoddemus
Copy link
Member

Closing, thanks for mentioning it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

4 participants