-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Closed
Copy link
Labels
testingRelated to testing Ruff itselfRelated to testing Ruff itselftyMulti-file analysis & type inferenceMulti-file analysis & type inference
Description
If you have a # revealed assertion on a line in an mdtest, and the revealed type is not what you are asserting, the output is something like this:
/src/test.py
line 16: unmatched assertion: revealed: tuple[Literal[A], Literal[B], Literal[C], Literal[A], Literal[object]]
line 16: unexpected error: [undefined-reveal] "`reveal_type` used without importing it; this is allowed for debugging convenience but will fail at runtime"
line 16: unexpected error: [revealed-type] "Revealed type is `tuple[Literal[A], Literal[X], Literal[Y], Literal[O], Literal[object]]`"
Really I only made a single mistake here: the revealed type is not what I asserted it would be. However, for this single mistake, I have to pay the "fine" of three (long) lines of mdtest output!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
testingRelated to testing Ruff itselfRelated to testing Ruff itselftyMulti-file analysis & type inferenceMulti-file analysis & type inference