File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export class ExecutionError {
25
25
/**
26
26
* Returns the traceback of the error as a string.
27
27
*/
28
- traceback ( ) : string {
28
+ get traceback ( ) : string {
29
29
return this . tracebackRaw . join ( '\n' )
30
30
}
31
31
}
Original file line number Diff line number Diff line change 4
4
def test_streaming_output ():
5
5
out = []
6
6
with CodeInterpreter () as sandbox :
7
+
7
8
def test (line ) -> int :
8
9
out .append (line )
9
10
return 1
11
+
10
12
sandbox .notebook .exec_cell ("print(1)" , on_stdout = test )
11
13
12
14
assert len (out ) == 1
@@ -16,7 +18,9 @@ def test(line) -> int:
16
18
def test_streaming_error ():
17
19
out = []
18
20
with CodeInterpreter () as sandbox :
19
- sandbox .notebook .exec_cell ("import sys;print(1, file=sys.stderr)" , on_stderr = out .append )
21
+ sandbox .notebook .exec_cell (
22
+ "import sys;print(1, file=sys.stderr)" , on_stderr = out .append
23
+ )
20
24
21
25
assert len (out ) == 1
22
26
assert out [0 ].line == "1\n "
@@ -41,4 +45,3 @@ def test_streaming_result():
41
45
sandbox .notebook .exec_cell (code , on_result = out .append )
42
46
43
47
assert len (out ) == 2
44
-
You can’t perform that action at this time.
0 commit comments