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

Padding repetition number? #87

Open
karrukola opened this issue Oct 15, 2024 · 0 comments
Open

Padding repetition number? #87

karrukola opened this issue Oct 15, 2024 · 0 comments

Comments

@karrukola
Copy link

Hello,
first of all, thank you for this plugin and all of your other work.

Would you be OK to update the test name by padding the iteration number?
I foresee a benefit in consuming the reports.
For instance when used in conjunction with pytest-html, sorting the tests by name would happen properly in the HTML report.

Right now, if I repeat a test 10 times, sorting the tests by name would look like:

test_something.py::test_do_nothing[1-10]
test_something.py::test_do_nothing[10-10] # this is out of order
test_something.py::test_do_nothing[2-10]
test_something.py::test_do_nothing[3-10]
# [...]

By padding wih either 0 or ' ', simple sorting would work

PASSED test_something.py::test_do_nothing[ 1-10]
PASSED test_something.py::test_do_nothing[ 2-10]
PASSED test_something.py::test_do_nothing[ 3-10]
# [...]
PASSED test_something.py::test_do_nothing[10-10]

I also prefer the way it gets printed on console during execution, but it is just a matter of personal taste.

I am happy to submit a working patch, if you like this proposal.
In case, let me know which padding character you prefer between 0 or ' '.

Kind regards,
Filippo

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

No branches or pull requests

1 participant