Skip to content

Improve summary stats when using '--collect-only' #7875

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

Merged
merged 13 commits into from
Nov 8, 2020
Merged

Improve summary stats when using '--collect-only' #7875

merged 13 commits into from
Nov 8, 2020

Conversation

caramelomartins
Copy link
Contributor

@caramelomartins caramelomartins commented Oct 8, 2020

Hey,

This PR intends to improve on the output of the summary stats line when using the --collection-only. I wrote it a bit "hackishly" because I was discovering the codebase so any feedback on improving the code, or the behavior, would be greatly appreciated. I also took the liberty of updating the existing tests to match this new behavior.

I tried to make the behavior similar to what was requested in #7701 and it results in something similar to:

==== 114 selected, 2891 deselected, no tests ran in 1.50s ====

Additionally, I noticed that in the examples found in the documentation, it only displays contexts where only "no tests ran in (...)s" happens...would it make sense to add more examples of different outputs?

Closes #7701.

Let me know how you feel about this.

Thanks!

@caramelomartins caramelomartins marked this pull request as ready for review October 8, 2020 18:48
@nicoddemus
Copy link
Member

Thanks @caramelomartins for the contribution!

Sorry for the delay, have been pretty busy.

I will take a closer look on this over the next few days, thanks for the patience!

@caramelomartins
Copy link
Contributor Author

It is okay @nicoddemus I just wasn't sure if was supposed to ask someone for a review or simply wait. 😂

@nicoddemus
Copy link
Member

It is okay @nicoddemus I just wasn't sure if was supposed to ask someone for a review or simply wait. 😂

Either way is fine, and a ping is always welcome. 😁

caramelomartins and others added 3 commits November 7, 2020 15:55
This now better separates the very different concerns now between
the summary status during normal runs and the new summary status
for "--collect-only".
@nicoddemus
Copy link
Member

Hi @caramelomartins!

This looks good, but I noticed we didn't have a specific test for all the cases we wanted to handle, so I added it. While at it decided to refactor the function because it had grown too much functionality and it was hard to follow.

For my part this is now good to go, I will wait a while for other maintainers to take a look if they want to. 👍

Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice improvement @caramelomartins. LGTM with a couple of comments inline, and also, I would change "X tests found" to "X tests collected" since that's the terminology we use.

@nicoddemus
Copy link
Member

I would change "X tests found" to "X tests collected" since that's the terminology we use.

Done. I did change to "matched" to convey when there was deselection, but it didn't work so well in the end. "collected" is perfect, don't know why it didn't occur to me, thanks!

All changes applied @bluetech. 👍

(I didn't bother changing the docs because they will be updated next time we run regendoc during the release).

@nicoddemus nicoddemus merged commit 5b2e5e8 into pytest-dev:master Nov 8, 2020
@nicoddemus
Copy link
Member

Thanks again @caramelomartins!

@caramelomartins caramelomartins deleted the 7701 branch November 8, 2020 15:06
@caramelomartins
Copy link
Contributor Author

@nicoddemus and @bluetech thanks for accepting this PR. Your suggestions and refactor made it much cleaner, thanks for the effort of making it better. 🙂

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

Successfully merging this pull request may close these issues.

Summary when using collection only is confusing
3 participants