flask
flask copied to clipboard
test_cli_runner() does not work as demonstrated in the documentation
In the documentation for 2.0.x forward, the use of the .invoke() method is showcased like so:
runner.invoke(["hello", "--name", "Flask"]).
However, the first positional argument to .invoke() is the command object:
def invoke(self, cli: t.Any = None, args: t.Any = None, **kwargs: t.Any ) -> t.Any:
So usage as described by the documentation won't work.
I'm quite confused as to why the documentation was changed when the method was never altered.
I suggest either the documentation be changed or the position of cli and args be switched.
Happy to review a PR that changes it to invoke(args=[...]), looks like I forgot to write the keyword in front.