-- Test cases for incremental error streaming.
-- Each time errors are reported, '==== Errors flushed ====' is printed.

[case testErrorStream]
import b
[file a.py]
1 + ''
[file b.py]
import a
'' / 2
[out]
==== Errors flushed ====
a.py:1: error: Unsupported operand types for + ("int" and "str")
==== Errors flushed ====
b.py:2: error: Unsupported operand types for / ("str" and "int")

[case testBlockers]
import b
[file a.py]
1 + ''
[file b.py]
import a
break
1 / ''  # won't get reported, after a blocker
[out]
==== Errors flushed ====
a.py:1: error: Unsupported operand types for + ("int" and "str")
==== Errors flushed ====
b.py:2: error: 'break' outside loop

[case testCycles]
import a
[file a.py]
import b
1 + ''
def f() -> int:
    reveal_type(b.x)
    return b.x
y = 0 + 0
[file b.py]
import a
def g() -> int:
    reveal_type(a.y)
    return a.y
1 / ''
x = 1 + 1

[out]
==== Errors flushed ====
b.py:3: error: Revealed type is 'builtins.int'
b.py:5: error: Unsupported operand types for / ("int" and "str")
==== Errors flushed ====
a.py:2: error: Unsupported operand types for + ("int" and "str")
a.py:4: error: Revealed type is 'builtins.int'
