mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-19 15:28:28 +01:00
Suppress tests output
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user