Open pedro-psb opened 1 month ago
pytest-timeout already announces itself in the reporting header like most other pytest plugins. I'm not sure I'm in favour of adding something like this, it adds maintenance complexity for very little in return. This feels more like a problem that should be solved in your CI pipeline or development communication.
If maintenance complexity is a concern, what about just changing the error message to be more explicit? I don't disagree with any of what you said, but regardless, informative error messages are generally helpful. IMO, the information that this was raised by the plugin is meaningful, as timeouts may have multiple sources.
The proposed message is much better
Let's use more obnoxious Exception type names+ expand the message text
This is for beginners friendlyness
I believe @flub just misunderstood the request?
Basically just change the message from Failed: Timeout >300.0s
to [pytest-timeout] For some reason this test is hanging: Timeout >300.0s
(not customizable or anything).
Seems trivial and indeed better.
I believe @flub just misunderstood the request?
He got it right, I proposed it to be customizable at first. That was an XY problem from my side. But yeah, the core request is to have a more informative error message title.
On Thu, Sep 12, 2024, at 11:49 AM, Pedro Brochado wrote:
I believe @flub https://github.com/flub just misunderstood the request?
He got it right, I proposed it to be customizable at first. That was an XY problem from my side. But yeah, the core request is to have a better error message.
Ahh I'm so sorry, just skimmed the original message.
But I think the change as written before (without customization) would be trivial and a net win.
Cheers,
Yeah, if people think the default message and exception types aren't clear enough that's probably more reasonable to change. Feel free to propose something, but I'll put some parameters around this:
It should be short, the section header should definitely render on an 80-columns wide terminal. Should probably aim to look good still in 60 columns.
It should be consistent with the rest of pytest's default UI.
Hey, I want to request the addition of a setting to change the pytest error message. E.g:
I work on a project made of plugins where the CI is quite complex and often changes.
The pytest-timeout was introduced by the CI team and some test failed due to timeout on the plugin I was looking at. It took some time to figure out that this was a plugin that was introduced, and a more explicit message would have been helpful.
I can submit a PR if that's ok.