You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[mypyc] Display IR on annotate test failure (#18835)
This makes it easier to figure out why a test is failing.
Example output on failure:
```
=================================== FAILURES ====================================
________________________ testAnnotateTwoOperationsOnLine ________________________
data: /Users/jukka/src/mypy/mypyc/test-data/annotate-basic.test:18:
Failed: Invalid source code output (/Users/jukka/src/mypy/mypyc/test-data/annotate-basic.test, line 18)
----------------------------- Captured stdout call ------------------------------
Generated IR:
def f(x):
x :: object
r0 :: str
r1, r2, r3 :: object
L0:
r0 = 'foo'
r1 = CPyObject_GetAttr(x, r0)
r2 = object 1
r3 = PyNumber_Add(r1, r2)
return r3
----------------------------- Captured stderr call ------------------------------
Expected:
main:2: Get non-native attribute "foo". Generic "+" operation.x (diff)
Actual:
main:2: Get non-native attribute "foo". Generic "+" operation. (diff)
Alignment of first line difference:
E: ...Generic "+" operation.x
A: ...Generic "+" operation.
^
Update the test output using --update-data (implies -n0; you can additionally use the -k selector to update only specific tests)
```
0 commit comments