Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Changing tests to be fully nose compatible
  • Loading branch information
henryiii committed Sep 27, 2017
1 parent 84bcdc3 commit b40ef46
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions IPython/core/tests/test_display.py
Expand Up @@ -11,6 +11,7 @@

from IPython.core import display
from IPython.core.getipython import get_ipython
from IPython.utils.io import capture_output
from IPython.utils.tempdir import NamedFileInTemporaryDirectory
from IPython import paths as ipath
from IPython.testing.tools import AssertPrints, AssertNotPrints
Expand Down Expand Up @@ -201,11 +202,12 @@ def test_progress():
p.progress = 5
nt.assert_equal(p._repr_html_(), "<progress style='width:100%' max='10' value='5'></progress>")

def test_progress_iter(capsys):
for i in display.ProgressBar(5):
out, err = capsys.readouterr()
nt.assert_in('{0}/5'.format(i), out)
out, err = capsys.readouterr()
def test_progress_iter():
with capture_output(display=False) as captured:
for i in display.ProgressBar(5):
out = captured.stdout
nt.assert_in('{0}/5'.format(i), out)
out = captured.stdout
nt.assert_in('5/5', out)

def test_json():
Expand Down

0 comments on commit b40ef46

Please sign in to comment.