Override a pytest parameterized functions name

You’re looking for the ids argument of pytest.mark.parametrize:

list of string ids, or a callable. If strings, each is corresponding
to the argvalues so that they are part of the test id. If callable, it
should take one argument (a single argvalue) and return a string or
return None.

Your code would look like

@pytest.mark.parametrize(
    ("testname", "op", "value"),
    [
        ("testA", "plus", "3"),
        ("testB", "minus", "1"),
    ],
    ids=['testA id', 'testB id']
)
def test_industry(self, testname, op, value):

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)