Skip to content

Better message in case of not using parametrized variable #1539

Closed
@pwilczynskiclearcode

Description

@pwilczynskiclearcode

py.test 2.9.1

In case of not using one of parametrized variables the following message is displayed:

/python2.7/site-packages/_pytest/python.py:237: in pytest_generate_tests
    metafunc.parametrize(*marker.args, **marker.kwargs)
/python2.7/site-packages/_pytest/python.py:1000: in parametrize
    raise ValueError("%r uses no fixture %r" %(self.function, arg))
E   ValueError: <function test_abc at 0x7f9bb394dde8> uses no fixture u'suffix'

where suffix isn't a fixture but missed variable from pytest.mark.parametrize.

Suggested enhancement: Raise Exception with a message suggesting using the suffix variable and not confuse developers about suffix fixture.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributorstatus: help wanteddevelopers would like help from experts on this topictopic: parametrizerelated to @pytest.mark.parametrizetopic: reportingrelated to terminal output and user-facing messages and errors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions