I have a pytest that looks like this:
@pytest.mark.parametrize(
"paramOne,paramTwo,paramThree,expected",
[
(True, False, False, "output one"),
(False, True, False, "output two"),
(False, False, True, "output three"),
],
)
def test__myfunc_method_should_do_something(
paramOne,
paramTwo,
paramThree,
expected,
):
assert myfunc.method(paramOne,paramTwo,paramThree) == expected
These parameterized tests show up in my IDE (vscode) and reports like this:
test__myfunc_method_should_do_something
True-False-False-output one
False-True-False-output two
False-False-True-output three
I would like it to look more like this though:
paramOne=True-paramTwo=False-paramThree=False-output one
paramOne=False-paramTwo=True-paramThree=False-output two
paramOne=False-paramTwo=False-paramThree=True-output three
Is there a way to include more metadata for how the parameterized tests are displayed, perhaps with ids?
I know I can manually name them like this:
@pytest.mark.parametrize(
"paramOne,paramTwo,paramTwo,expected",
[
(True, False, False, "output one"),
(False, True, False, "output two"),
(False, False, True, "output three"),
],
ids=["one", "two", "three"],
)
But is there a way to dynamically have ids just display the name and value of each param? Without me having to manually configure it for each one?