Show More
@@ -1,19 +1,21 | |||||
1 | from IPython.testing.tools import AssertPrints, AssertNotPrints |
|
1 | from IPython.testing.tools import AssertPrints, AssertNotPrints | |
2 |
|
2 | |||
|
3 | ip = get_ipython() | |||
|
4 | ||||
3 | def test_output_displayed(): |
|
5 | def test_output_displayed(): | |
4 | """Checking to make sure that output is displayed""" |
|
6 | """Checking to make sure that output is displayed""" | |
5 |
|
7 | |||
6 | with AssertPrints('2'): |
|
8 | with AssertPrints('2'): | |
7 | ip.run_cell('1+1') |
|
9 | ip.run_cell('1+1',store_history=True) | |
8 |
|
10 | |||
9 | with AssertPrints('2'): |
|
11 | with AssertPrints('2'): | |
10 | ip.run_cell('1+1 # comment with a semicolon;') |
|
12 | ip.run_cell('1+1 # comment with a semicolon;',store_history=True) | |
11 |
|
13 | |||
12 | def test_output_quiet(): |
|
14 | def test_output_quiet(): | |
13 | """Checking to make sure that output is quiet""" |
|
15 | """Checking to make sure that output is quiet""" | |
14 |
|
16 | |||
15 | with AssertNotPrints('2'): |
|
17 | with AssertNotPrints('2'): | |
16 | ip.run_cell('1+1;') |
|
18 | ip.run_cell('1+1;',store_history=True) | |
17 |
|
19 | |||
18 | with AssertNotPrints('2'): |
|
20 | with AssertNotPrints('2'): | |
19 | ip.run_cell('1+1; # comment with a semicolon') |
|
21 | ip.run_cell('1+1; # comment with a semicolon',store_history=True) |
General Comments 0
You need to be logged in to leave comments.
Login now