string loader permalink

Use the string loader to inject a pipeline directly into pypyr without needing to save it to file first.

Specify pypyr.loaders.string for loader, and pass the pipeline body as a string to the pipeline_name argument.

from pypyr import pipelinerunner

pipeline = """\
steps:
- name: pypyr.steps.set
  in:
    set:
      test: 1
"""

context = pipelinerunner.run(pipeline_name=pipeline,
                             loader='pypyr.loaders.string')

assert context['test'] == 1
print(context)

see also

last updated on .