def test_pype_use_parent_context_with_swallow(mock_run_pipeline):
"""pype swallowing error in child pipeline."""
context = Context({
'pype': {
'name': 'pipe name',
'pipeArg': 'argument here',
'useParentContext': True,
'skipParse': True,
'raiseError': False
}
})
logger = logging.getLogger('pypyr.steps.pype')
with patch.object(logger, 'error') as mock_logger_error:
pype.run_step(context)
mock_run_pipeline.assert_called_once_with(
pipeline_name='pipe name',
pipeline_context_input='argument here',
context=context,
parse_input=False)
mock_logger_error.assert_called_once_with(
'Something went wrong pyping pipe name. RuntimeError: whoops')
# ------------------------ run_step --------------------------------------
评论列表
文章目录