From be0a8e6a964a1d1e3742a1f01a94f1ed08fca557 2015-06-03 18:24:40 From: nottaanibot Date: 2015-06-03 18:24:40 Subject: [PATCH] Added tests for displayhook Work in progress. Tests will fail but we will fix them. --- diff --git a/IPython/core/tests/test_displayhook.py b/IPython/core/tests/test_displayhook.py index 01b2d72..bae37c1 100644 --- a/IPython/core/tests/test_displayhook.py +++ b/IPython/core/tests/test_displayhook.py @@ -1 +1,19 @@ -code +from IPython.testing.tools import AssertPrints, AssertNotPrints + +def test_output_displayed(): + """Checking to make sure that output is displayed""" + + with AssertPrints('2'): + ip.run_cell('1+1') + + with AssertPrints('2'): + ip.run_cell('1+1 # comment with a semicolon;') + +def test_output_quiet(): + """Checking to make sure that output is quiet""" + + with AssertNotPrints('2'): + ip.run_cell('1+1;') + + with AssertNotPrints('2'): + ip.run_cell('1+1; # comment with a semicolon')