Is there an example of how to best test/mock gate ...
# ask-the-community
b
Is there an example of how to best test/mock gate nodes within flytekit? Looking to test a workflow using
wait_for_input
.
k
I do not think we do but ideally, you’re right it should be like an Stdin emulator
b
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"))
e
yeah, this is a good idea. we should turn this into a test utility (or maybe just an example using monkeypatching). @Bernhard Stadlbauer , can you open an issue?
k
i think we should just make it like click.runner?
157 Views