Skip to content

Commit c9952ec

Browse files
committed
TST: use capsys in console print test
1 parent b42b389 commit c9952ec

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/test_magics.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from IPython.utils.io import capture_output
21
from pytest import raises
32

43

@@ -157,7 +156,6 @@ def test_space_outputs_to_console(ip, capsys):
157156
assert capsys.readouterr().out == "100\n"
158157

159158

160-
def test_space_can_print_to_console(ip):
161-
with capture_output() as captured:
162-
ip.run_cell_magic(magic_name="space", line="tomato", cell="print(100)")
163-
assert captured.stdout == "100\n"
159+
def test_space_can_print_to_console(ip, capsys):
160+
ip.run_cell_magic(magic_name="space", line="tomato", cell="print(100)")
161+
assert capsys.readouterr().out == "100\n"

0 commit comments

Comments
 (0)