-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
enhancementEnhances DVCEnhances DVCp2-mediumMedium priority, should be done, but less importantMedium priority, should be done, but less important
Description
Currently, when we want to check stderr/stdout we need to do a lot of different actions like
from tests.utils import reset_logger_error_output, reset_logger_standard_output
from tests.utils.logger import MockLoggerHandlers, ConsoleFontColorsRemove
...
with MockLoggerHandlers(logger), ConsoleFontColorsRemover():
reset_logger_error_output()
...
self.assertIn(
"unable to read stage file: {} "
"YAML file structure is corrupted".format(foo_stage),
logger.handlers[1].stream.getvalue(),
)
from https://github.com/iterative/dvc/blob/0.32.1/tests/test_add.py .
which is way too many actions to simply check for stderr output. It seems like we could do better than that by unifying all of this into something like:
with MockStderr as stderr:
self.assertEqual(stderr, "expected")
without having to import a bunch of stuff.
ei-grad and pared
Metadata
Metadata
Assignees
Labels
enhancementEnhances DVCEnhances DVCp2-mediumMedium priority, should be done, but less importantMedium priority, should be done, but less important