forked from python/mypy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrorstream.test
More file actions
54 lines (50 loc) · 1.13 KB
/
errorstream.test
File metadata and controls
54 lines (50 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
-- 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: note: 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: note: Revealed type is 'builtins.int'