Is there an example of how to best test/mock gate ...
# flyte-support
a
Is there an example of how to best test/mock gate nodes within flytekit? Looking to test a workflow using
wait_for_input
.
f
I do not think we do but ideally, you’re right it should be like an Stdin emulator
a
In case anyone ever needs it, the following has worked for me (using `pytest`s
monkeypatch
fixture):
Copy code
monkeypatch.setattr("sys.stdin", io.StringIO("your input"))
h
yeah, this is a good idea. we should turn this into a test utility (or maybe just an example using monkeypatching). @agreeable-kitchen-44189 , can you open an issue?
f
i think we should just make it like click.runner?
157 Views