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

Supply custom error message on timeout tests #4

Open
Voileexperiments opened this issue Apr 22, 2018 · 1 comment
Open

Supply custom error message on timeout tests #4

Voileexperiments opened this issue Apr 22, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@Voileexperiments
Copy link

Currently both JS and Python versions have test constructs to test if some pieces of code runs under a certain time limit, but they do not allow the use of custom error message like every other test constructs do.

So, like @timeout(sec) should become @timeout(sec, msg) with a default value?

@kazk kazk transferred this issue from codewars/codewars-runner-cli Mar 27, 2020
@kazk kazk added the enhancement New feature or request label Mar 27, 2020
@FArekkusu
Copy link
Contributor

Is this really required? The only error message which makes sense for the timeout decorator is "Exceeded time limit of N seconds", and that's exactly what it says right now.

Moreover, the default error message must always be prepended in case somebody decides to pass something useless as the msg argument (e.g. like it's done with assert_equals); so the purpose of this custom messages is... to add a comment?

Blind4Basics added a commit to Blind4Basics/python-test-framework that referenced this issue Jun 29, 2021
* removed the use of `test.expect_no_error` inside the timeout utility:
  - done "manually", allowing to handle data passed to the thread
  - consequence: DOCS need an update because there isn't any extra assertion anymore, now.

* tested on cw with 3.6, 3.8 wihtout imports, 3.8 with imports: work as expected.

* removed a comment in the framework about the timeout (deprecated info)

* added the default message for timeout ssertion (codewars#4)

Still need to upddate the tests output (and maybe the tests files)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants