##// END OF EJS Templates
adapt DisplayHook.quiet() for multiline input
Sebastian Bank -
Show More
@@ -96,7 +96,7 b' class DisplayHook(Configurable):'
96 96 tokens = list(tokenize.generate_tokens(sio.readline))
97 97
98 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 100 continue
101 101 if (token[0] == tokenize.OP) and (token[1] == ';'):
102 102 return True
@@ -11,6 +11,10 b' def test_output_displayed():'
11 11 with AssertPrints('2'):
12 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 18 def test_output_quiet():
15 19 """Checking to make sure that output is quiet"""
16 20
@@ -19,3 +23,6 b' def test_output_quiet():'
19 23
20 24 with AssertNotPrints('2'):
21 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