Suppress tests output

This commit is contained in:
Dmitry
2019-02-19 13:03:37 -08:00
parent c1cdf77414
commit fecaa5a0a2
5 changed files with 52 additions and 22 deletions
+11 -9
View File
@@ -11,6 +11,7 @@ import copy
from dvc.state import State
from mock import patch
from tests.utils.logger import MockLoggerHandlers
import dvc.logger as logger
from dvc.utils.compat import str
@@ -637,15 +638,16 @@ class TestWarnOnOutdatedStage(TestDvc):
with open(stage_file_path, "w") as stage_file:
yaml.dump(content, stage_file)
logger.logger.handlers[0].stream = StringIO()
self.main(["status", "-c"])
self.assertIn(
"Warning: Output 'bar'(Stage: 'bar.dvc') is "
"missing version info. Cache for it will not be "
"collected. Use dvc repro to get your pipeline up to "
"date.",
logger.logger.handlers[0].stream.getvalue(),
)
with MockLoggerHandlers(logger.logger):
logger.logger.handlers[0].stream = StringIO()
self.main(["status", "-c"])
self.assertIn(
"Warning: Output 'bar'(Stage: 'bar.dvc') is "
"missing version info. Cache for it will not be "
"collected. Use dvc repro to get your pipeline up to "
"date.",
logger.logger.handlers[0].stream.getvalue(),
)
def test(self):
self.color_patch.start()