Skip to content

Conversation

FArekkusu
Copy link
Contributor

@FArekkusu FArekkusu commented Mar 22, 2020

As expect_no_error silently consumes any exceptions raised in the code, the user may have no information about what's happening or why some particular test failed. Normally, authors have to specify a custom error message to avoid this, but this is not the case with the timeout decorator: it delegates execution to expect_no_error while catching all exceptions with a useless "Should not throw any exception inside timeout" error message. This quick fix should make timed blocks more informative on failure, and provide some minimal info if an empty string is passed as the message argument.

@kazk kazk self-assigned this Mar 24, 2020
@FArekkusu
Copy link
Contributor Author

@kazk could you take a look at this PR when you have time? I've created it because some kata was silently consuming errors with no feedback, and now the same issue appeared here. It'd be better if this was fixed in the framework itself, instead of raising the same issue and copy-pasting the same fix in every kata requiring the expect_no_error tests.

Copy link
Member

@kazk kazk left a comment

Choose a reason for hiding this comment

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

Thanks! Sorry for the delay. Looks good to me.

@kazk kazk merged commit b3821b0 into codewars:master Apr 22, 2020
@kazk
Copy link
Member

kazk commented Apr 22, 2020

I'll update Python 3.6 and let you know when it's deployed.

@kazk
Copy link
Member

kazk commented Apr 23, 2020

Deployed

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

Successfully merging this pull request may close these issues.

2 participants