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

Added an exception handler in the asyncio test runner #225

Merged
merged 12 commits into from
Mar 6, 2021

Conversation

agronholm
Copy link
Owner

It will now raise all the capture exceptions if the test function completes without raising any exceptions of its own.

Closes #205.

It will now raise all the capture exceptions if the test function completes without raising any exceptions of its own.

Closes #205.
@agronholm agronholm requested a review from graingert March 2, 2021 15:11
Comment on lines 86 to 87
result.assert_outcomes(passed=3 * len(get_all_backends()) + 1, skipped=len(get_all_backends()),
failed=1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd expect test_asyncio_exception_handler to pass, then fail in teardown:

Suggested change
result.assert_outcomes(passed=3 * len(get_all_backends()) + 1, skipped=len(get_all_backends()),
failed=1)
result.assert_outcomes(passed=3 * len(get_all_backends()) + 2, skipped=len(get_all_backends()),
failed=1)

Copy link
Owner Author

Choose a reason for hiding this comment

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

Why? The exception is raised during the actual test run (albeit in a callback), not during fixture teardown.

@agronholm
Copy link
Owner Author

I'll merge this tomorrow unless you have some concerns left.

@agronholm agronholm merged commit 57516af into master Mar 6, 2021
@agronholm agronholm deleted the asynciohandler branch March 6, 2021 10:16
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.

during asyncio tests set a default loop exception_handler that warns (similar to -p unraisablehook)
2 participants