Skip to content

Commit

Permalink
✅ Fix tests for compatibility with both Click 8 and 7
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Aug 30, 2021
1 parent f65e8c6 commit 9bfe111
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion tests/test_compat/test_option_get_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ def test_completion():
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "Jonny" in result.stdout
# TODO: when deprecating Click 7, remove second option
assert "Jonny" in result.stdout or "_files" in result.stdout
5 changes: 2 additions & 3 deletions tests/test_tutorial/test_using_click/test_tutorial003.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@

def test_cli():
result = runner.invoke(mod.typer_click_object, [])
assert "Usage" in result.stdout
assert "hello" in result.stdout
assert "top" in result.stdout
# TODO: when deprecating Click 7, remove second option
assert "Error: Missing command" in result.stdout or "Usage" in result.stdout


def test_typer():
Expand Down

0 comments on commit 9bfe111

Please sign in to comment.