Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/test_others.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def main(arg1, arg2: int, arg3: "int", arg4: bool = False, arg5: "bool" = False)

result = runner.invoke(app, ["Hello", "2", "invalid"])

assert "Invalid value for 'ARG3': 'invalid' is not a valid integer" in result.stdout
assert "Invalid value for 'ARG3': 'invalid' is not a valid integer" in result.output
result = runner.invoke(app, ["Hello", "2", "3", "--arg4", "--arg5"])
assert (
"arg1: <class 'str'> Hello\narg2: <class 'int'> 2\narg3: <class 'int'> 3\narg4: <class 'bool'> True\narg5: <class 'bool'> True\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_call_no_arg_no_rich():
typer.core.rich = None
result = runner.invoke(app)
assert result.exit_code != 0
assert "Error: Missing argument 'NAME'" in result.stdout
assert "Error: Missing argument 'NAME'" in result.output
typer.core.rich = rich


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_call_no_arg_no_rich():
typer.core.rich = None
result = runner.invoke(app)
assert result.exit_code != 0
assert "Error: Missing argument 'NAME'" in result.stdout
assert "Error: Missing argument 'NAME'" in result.output
typer.core.rich = rich


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_call_no_arg_no_rich():
typer.core.rich = None
result = runner.invoke(app)
assert result.exit_code != 0
assert "Error: Missing argument 'NAME'" in result.stdout
assert "Error: Missing argument 'NAME'" in result.output
typer.core.rich = rich


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_defaults():
def test_invalid_args():
result = runner.invoke(app, ["Draco", "Hagrid"])
assert result.exit_code != 0
assert "Argument 'names' takes 3 values" in result.stdout
assert "Argument 'names' takes 3 values" in result.output


def test_valid_args():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_defaults():
def test_invalid_args():
result = runner.invoke(app, ["Draco", "Hagrid"])
assert result.exit_code != 0
assert "Argument 'names' takes 3 values" in result.stdout
assert "Argument 'names' takes 3 values" in result.output


def test_valid_args():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_invalid():
assert result.exit_code != 0
assert (
"Invalid value for 'BIRTH:[%Y-%m-%d|%Y-%m-%dT%H:%M:%S|%Y-%m-%d %H:%M:%S]':"
in result.stdout
in result.output
)
assert "'july-19-1989' does not match the formats" in result.output
assert "%Y-%m-%d" in result.output
Expand Down
4 changes: 2 additions & 2 deletions tests/test_tutorial/test_terminating/test_tutorial003.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def test_root_no_rich():
typer.core.rich = None
result = runner.invoke(app, ["root"])
assert result.exit_code == 1
assert "The root user is reserved" in result.stdout
assert "Aborted!" in result.stdout
assert "The root user is reserved" in result.output
assert "Aborted!" in result.output
typer.core.rich = rich


Expand Down
2 changes: 1 addition & 1 deletion tests/test_tutorial/test_using_click/test_tutorial003.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def test_cli():
result = runner.invoke(mod.typer_click_object, [])
assert "Missing command" in result.stdout
assert "Missing command" in result.output


def test_help():
Expand Down
6 changes: 3 additions & 3 deletions tests/test_tutorial/test_using_click/test_tutorial004.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

def test_cli():
result = runner.invoke(mod.cli, [])
assert "Usage" in result.stdout
assert "dropdb" in result.stdout
assert "sub" in result.stdout
assert "Usage" in result.output
assert "dropdb" in result.output
assert "sub" in result.output


def test_typer():
Expand Down
Loading