flask icon indicating copy to clipboard operation
flask copied to clipboard

test_cli_runner() does not work as demonstrated in the documentation

Open flonle opened this issue 4 years ago • 1 comments

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.

flonle avatar Apr 08 '22 11:04 flonle

Happy to review a PR that changes it to invoke(args=[...]), looks like I forgot to write the keyword in front.

davidism avatar Apr 08 '22 13:04 davidism