https://flyte.org logo
#ask-the-community
Title
# ask-the-community
b

Bernhard Stadlbauer

04/20/2023, 2:51 PM
Is there an example of how to best test/mock gate nodes within flytekit? Looking to test a workflow using
wait_for_input
.
k

Ketan (kumare3)

04/20/2023, 3:21 PM
I do not think we do but ideally, you’re right it should be like an Stdin emulator
b

Bernhard Stadlbauer

04/20/2023, 4:43 PM
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

Eduardo Apolinario (eapolinario)

04/20/2023, 5:38 PM
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

Ketan (kumare3)

04/20/2023, 6:41 PM
i think we should just make it like click.runner?
8 Views