我一直在尝试从python中的模拟引发异常,但我不断
AssertionError: Exception not raised
@patch('__builtin__.open')
@patch('src.pipeline_config.yaml.load', return_value={"pipeline_config_list": []})
def test_get_pipeline_config_raises_exception(self, mock_open, mock_yaml):
app = Flask(__name__)
with app.app_context():
with self.assertRaises(IOError):
mock_open.side_effect = IOError()
get_pipeline_config_list(None, "username")