##// END OF EJS Templates
adapt DisplayHook.quiet() for multiline input
Sebastian Bank -
Show More
@@ -96,7 +96,7 b' class DisplayHook(Configurable):'
96 tokens = list(tokenize.generate_tokens(sio.readline))
96 tokens = list(tokenize.generate_tokens(sio.readline))
97
97
98 for token in reversed(tokens):
98 for token in reversed(tokens):
99 if token[0] in (tokenize.ENDMARKER, tokenize.COMMENT):
99 if token[0] in (tokenize.ENDMARKER, tokenize.NL, tokenize.NEWLINE, tokenize.COMMENT):
100 continue
100 continue
101 if (token[0] == tokenize.OP) and (token[1] == ';'):
101 if (token[0] == tokenize.OP) and (token[1] == ';'):
102 return True
102 return True
@@ -11,6 +11,10 b' def test_output_displayed():'
11 with AssertPrints('2'):
11 with AssertPrints('2'):
12 ip.run_cell('1+1 # comment with a semicolon;', store_history=True)
12 ip.run_cell('1+1 # comment with a semicolon;', store_history=True)
13
13
14 with AssertPrints('2'):
15 ip.run_cell('1+1\n#commented_out_function();', store_history=True)
16
17
14 def test_output_quiet():
18 def test_output_quiet():
15 """Checking to make sure that output is quiet"""
19 """Checking to make sure that output is quiet"""
16
20
@@ -19,3 +23,6 b' def test_output_quiet():'
19
23
20 with AssertNotPrints('2'):
24 with AssertNotPrints('2'):
21 ip.run_cell('1+1; # comment with a semicolon', store_history=True)
25 ip.run_cell('1+1; # comment with a semicolon', store_history=True)
26
27 with AssertNotPrints('2'):
28 ip.run_cell('1+1;\n#commented_out_function()', store_history=True)
General Comments 0
You need to be logged in to leave comments. Login now