pytest-testdox
pytest-testdox copied to clipboard
Format output for parametrized tests
Thanks for the nifty little package @renanivo!
I was wondering if it made sense to format parametrized tests, perhaps behind an opt-in flag/config option. For example:
@pytest.mark.parametrize("parameter", ["blue", "yellow", "green"])
def test_passes_with_parameters(parameter):
assert True
So you'd go from:
test_demo.py
demo
✓ passes with parameters[blue]
✓ passes with parameters[yellow]
✓ passes with parameters[green]
To:
test_demo.py
demo
✓ passes with parameters
✓ blue
✓ yellow
✓ green
Or something like that :) maybe without the ✓
on the root-level, whichever is easier and makes more sense.
Hi @nejch. Thanks for your suggestion.
That's something I always wanted to do, but never started. As you have mentioned, the ✓ at the root level would be harder to do because it would require us to wait for the child nodes to execute before printing it, which might be troublesome when an exception happens.
I added the "feature request" label and will probably start working on it in the next couple weeks, but if you (or anyone else) want to do it, just let me know 🙂