Originally reported by: BitBucket: wtanksleyjr, GitHub: wtanksleyjr
Asserts inside doctests don't parse correctly; they instead produce an error that points to the wrong line. It looks like the backtrace is getting confused.
It may be possible to fix this specific error by finding a bug in our doctest code; but it may also be possible to handle the general case where the backtracking information doesn't lead into the test code. When that happens, it would be ideal to show an error message that points to the last line of test code run, even if the location isn't in the backtrace.
I've attached doc.py to demonstrate the assert problem.
Originally reported by: BitBucket: wtanksleyjr, GitHub: wtanksleyjr
Asserts inside doctests don't parse correctly; they instead produce an error that points to the wrong line. It looks like the backtrace is getting confused.
It may be possible to fix this specific error by finding a bug in our doctest code; but it may also be possible to handle the general case where the backtracking information doesn't lead into the test code. When that happens, it would be ideal to show an error message that points to the last line of test code run, even if the location isn't in the backtrace.
I've attached doc.py to demonstrate the assert problem.