Skip to content

Support return value when using CliRunner #559

Answered by GiorgioSgl
jayqi asked this question in Questions
Discussion options

You must be logged in to vote

Just found how to fix this just run the invoke method with standalone_mode=False

def test_app():
    result = runner.invoke(
        app, ["command"], standalone_mode=False
    )

    assert result.exit_code == 0
    print(result.return_value) # print the result and not get None

Idea by this

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jayqi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
2 participants