Closed Mitmischer closed 3 years ago
The runner is also used to test the default "standalone mode", so it can't disable it unconditionally. Therefore, if you want to write tests that look at the return value, you have to tell the runner that by passing invoke(standalone_mode=False)
. We do this in Click's tests too.
In the documentation to CliRunner::invoke, it says that
However I don't see this reflected, see this example:
I expected result.return_value to be "arg".
The fix should be calling cli.main with standalone_mode == False here. I don't know if that would break other use cases though. So maybe it would also make sense to mimic the
standalone
flag inCliRunner.invoke
.Environment: