I have created a BytesIO object for yaml file as below:
config = (b\'parser\\n\' b\'\\tsheet: Requirements\') data = dict(file=(io.BytesIO(config)