Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
marscher committed Jul 21, 2016
1 parent 159b4f7 commit 6159b7a
Showing 1 changed file with 12 additions and 43 deletions.
55 changes: 12 additions & 43 deletions pyemma/_base/tests/test_progress.py
Original file line number Diff line number Diff line change
@@ -23,58 +23,27 @@
'''

from __future__ import absolute_import

import unittest

from six.moves import range

from pyemma._base.progress import ProgressReporter
from pyemma._base.progress.bar import ProgressBar
from six.moves import range
from pyemma import config


class TestProgress(unittest.TestCase):

# FIXME: does not work with nose (because nose already captures stdout)
"""
def test_silenced(self):
reporter = ProgressReporter()
reporter._register(1)
reporter.silence_progress = True
from StringIO import StringIO
saved_stdout = sys.stdout
try:
out = StringIO()
sys.stdout = out
# call the update method to potentially create output
reporter._update(1)
output = out.getvalue().strip()
# in silence mode we do not want any output!
assert output == ''
finally:
sys.stdout = saved_stdout
def test_not_silenced(self):
reporter = ProgressReporter()
reporter._register(1)
reporter.silence_progress = False
from StringIO import StringIO
saved_stdout = sys.stdout
try:
out = StringIO()
sys.stdout = out
# call the update method to potentially create output
reporter._update(1)
output = out.getvalue().strip()
# in silence mode we do not want any output!
print output
assert output is not ''
finally:
sys.stdout = saved_stdout
"""
@classmethod
def setUpClass(cls):
config.show_progress_bars = True

def test_callback(self):
@classmethod
def tearDownClass(cls):
config.show_progress_bars = False

def test_callback(self):
self.has_been_called = 0

def call_back(stage, progressbar, *args, **kw):

0 comments on commit 6159b7a

Please sign in to comment.