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

Format output for parametrized tests #77

Open
nejch opened this issue May 27, 2022 · 1 comment
Open

Format output for parametrized tests #77

nejch opened this issue May 27, 2022 · 1 comment

Comments

@nejch
Copy link
Contributor

nejch commented May 27, 2022

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.

@renanivo
Copy link
Owner

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 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants