##// END OF EJS Templates
Use AssertPrints in test_magic.
Thomas Kluyver -
Show More
@@ -174,17 +174,10 b' def test_macro_run():'
174 ip.run_cell(cmd)
174 ip.run_cell(cmd)
175 nt.assert_equal(ip.user_ns["test"].value,
175 nt.assert_equal(ip.user_ns["test"].value,
176 py3compat.doctest_refactor_print("a+=1\nprint a\n"))
176 py3compat.doctest_refactor_print("a+=1\nprint a\n"))
177 original_stdout = sys.stdout
177 with tt.AssertPrints("12"):
178 new_stdout = StringIO()
179 sys.stdout = new_stdout
180 try:
181 ip.run_cell("test")
178 ip.run_cell("test")
182 nt.assert_true("12" in new_stdout.getvalue())
179 with tt.AssertPrints("13"):
183 ip.run_cell("test")
180 ip.run_cell("test")
184 nt.assert_true("13" in new_stdout.getvalue())
185 finally:
186 sys.stdout = original_stdout
187 new_stdout.close()
188
181
189
182
190 # XXX failing for now, until we get clearcmd out of quarantine. But we should
183 # XXX failing for now, until we get clearcmd out of quarantine. But we should
General Comments 0
You need to be logged in to leave comments. Login now