Skip to content

Lint, add expect_no_error and improve timeout #1

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 1 commit into from
Feb 15, 2019

Conversation

Bubbler-4
Copy link
Contributor

Added feature

expect_no_error(message, function, exception=BaseException)

Tests if the function, when run, does not raise any exception that can be caught by exception. Generates a failed assertion if not met.

Improved feature

@timeout(sec)

The wrapped function is again wrapped inside expect_no_error, so that any exception raised inside the child process can be caught right there. If this happens, generates a failed assertion.

Demo

This kumite includes a demo with the two new functions copied into Preloaded. If run as-is, the timed block fails instantly. If run without raise in solution, the timed block fails by timeout as usual.

Related issue

Fixes codewars/codewars-runner-cli#698

@kazk kazk self-assigned this Feb 15, 2019
@kazk kazk merged commit 5e959d8 into codewars:master Feb 15, 2019
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