Open
Description
With fail_after
, it's a bit annoying that it can't show you where the block was cancelled. (The traceback just starts at the end of the scope.)
This will be a problem in particular for test timeouts. (Well, they probably won't use fail_after
, but they'll have the same problem.)
I don't think we can capture the exceptions in cancel scope objects by default, because we don't want to pin the stacks in memory.
We could have a flag that tells it to save caught exceptions, though. Or try to do something clever with catching them ourselves inside the scope, but that's basically the same thing from the user point of view, and the cancel scope already knows how to reliably catch its own exceptions.