Skip to content

assert failure inside doctest doesn't prettyprint #7

Description

@pytestbot

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.


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions