Johannes Müller
08/28/2023, 2:14 PMsandy
08/28/2023, 3:15 PMbuild_op_context
doesn't provide enough flexibility? If not, does passing in a MagicMock
when invoking the op work? If not, mind filing a Github issue with an example of what you'd like to work?Johannes Müller
08/29/2023, 5:05 AMbuild_op_context
should work nicely. I think I am missing the step on how to pass that context to a job I am testing:
my_context = build_op_context()
my_job.execute_in_process( # <-- How do I pass the op context here?
run_config=RunConfig(resources={'slack': DummyResource()})
)
@job(
resource_defs={
"slack": slack_resource.configured({"token": "xoxb-123456"}),
},
hooks={slack_message_on_failure},
)
def my_job():
my_op_with_context()
Johannes Müller
08/29/2023, 1:37 PMsandy
08/29/2023, 9:00 PMexecute_in_process