Skip to content

Commit

Permalink
✅ Remove no longer needed env var for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed Mar 30, 2024
1 parent d6fd041 commit 2967b16
Show file tree
Hide file tree
Showing 27 changed files with 0 additions and 55 deletions.
1 change: 0 additions & 1 deletion tests/test_cli/test_completion_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def test_script_completion_run():
"_PYTHON _M TYPER_COMPLETE": "complete_bash",
"COMP_WORDS": "typer tests/assets/cli/sample.py",
"COMP_CWORD": "2",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "run" in result.stdout
1 change: 0 additions & 1 deletion tests/test_cli/test_sub_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def test_script_completion_run():
"_PYTHON _M TYPER_COMPLETE": "complete_bash",
"COMP_WORDS": "typer tests/assets/cli/sample.py run hello --",
"COMP_CWORD": "4",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "--name" in result.stdout
1 change: 0 additions & 1 deletion tests/test_compat/test_option_get_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def test_completion():
**os.environ,
"_COMPAT_CLICK7_8.PY_COMPLETE": "complete_zsh",
"_TYPER_COMPLETE_ARGS": "compat_click7_8.py --nickname ",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "Jonny" in result.stdout
8 changes: 0 additions & 8 deletions tests/test_completion/test_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def test_completion_invalid_instruction():
env={
**os.environ,
"_TUTORIAL001.PY_COMPLETE": "sourcebash",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert result.returncode != 0
Expand All @@ -66,7 +65,6 @@ def test_completion_source_bash():
env={
**os.environ,
"_TUTORIAL001.PY_COMPLETE": "source_bash",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert (
Expand All @@ -83,7 +81,6 @@ def test_completion_source_invalid_shell():
env={
**os.environ,
"_TUTORIAL001.PY_COMPLETE": "source_xxx",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "Shell xxx not supported." in result.stderr
Expand All @@ -97,7 +94,6 @@ def test_completion_source_invalid_instruction():
env={
**os.environ,
"_TUTORIAL001.PY_COMPLETE": "explode_bash",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert 'Completion instruction "explode" not supported.' in result.stderr
Expand All @@ -111,7 +107,6 @@ def test_completion_source_zsh():
env={
**os.environ,
"_TUTORIAL001.PY_COMPLETE": "source_zsh",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "compdef _tutorial001py_completion tutorial001.py" in result.stdout
Expand All @@ -125,7 +120,6 @@ def test_completion_source_fish():
env={
**os.environ,
"_TUTORIAL001.PY_COMPLETE": "source_fish",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "complete --command tutorial001.py --no-files" in result.stdout
Expand All @@ -139,7 +133,6 @@ def test_completion_source_powershell():
env={
**os.environ,
"_TUTORIAL001.PY_COMPLETE": "source_powershell",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert (
Expand All @@ -156,7 +149,6 @@ def test_completion_source_pwsh():
env={
**os.environ,
"_TUTORIAL001.PY_COMPLETE": "source_pwsh",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert (
Expand Down
10 changes: 0 additions & 10 deletions tests/test_completion/test_completion_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def test_completion_complete_subcommand_bash():
"_TUTORIAL001.PY_COMPLETE": "complete_bash",
"COMP_WORDS": "tutorial001.py del",
"COMP_CWORD": "1",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "delete\ndelete-all" in result.stdout
Expand All @@ -31,7 +30,6 @@ def test_completion_complete_subcommand_bash_invalid():
"_TUTORIAL001.PY_COMPLETE": "complete_bash",
"COMP_WORDS": "tutorial001.py del",
"COMP_CWORD": "42",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "create\ndelete\ndelete-all\ninit" in result.stdout
Expand All @@ -46,7 +44,6 @@ def test_completion_complete_subcommand_zsh():
**os.environ,
"_TUTORIAL001.PY_COMPLETE": "complete_zsh",
"_TYPER_COMPLETE_ARGS": "tutorial001.py del",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert (
Expand All @@ -64,7 +61,6 @@ def test_completion_complete_subcommand_zsh_files():
**os.environ,
"_TUTORIAL001.PY_COMPLETE": "complete_zsh",
"_TYPER_COMPLETE_ARGS": "tutorial001.py delete ",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert ("_files") in result.stdout
Expand All @@ -80,7 +76,6 @@ def test_completion_complete_subcommand_fish():
"_TUTORIAL001.PY_COMPLETE": "complete_fish",
"_TYPER_COMPLETE_ARGS": "tutorial001.py del",
"_TYPER_COMPLETE_FISH_ACTION": "get-args",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert (
Expand All @@ -99,7 +94,6 @@ def test_completion_complete_subcommand_fish_should_complete():
"_TUTORIAL001.PY_COMPLETE": "complete_fish",
"_TYPER_COMPLETE_ARGS": "tutorial001.py del",
"_TYPER_COMPLETE_FISH_ACTION": "is-args",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert result.returncode == 0
Expand All @@ -115,7 +109,6 @@ def test_completion_complete_subcommand_fish_should_complete_no():
"_TUTORIAL001.PY_COMPLETE": "complete_fish",
"_TYPER_COMPLETE_ARGS": "tutorial001.py delete ",
"_TYPER_COMPLETE_FISH_ACTION": "is-args",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert result.returncode != 0
Expand All @@ -130,7 +123,6 @@ def test_completion_complete_subcommand_powershell():
**os.environ,
"_TUTORIAL001.PY_COMPLETE": "complete_powershell",
"_TYPER_COMPLETE_ARGS": "tutorial001.py del",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert (
Expand All @@ -147,7 +139,6 @@ def test_completion_complete_subcommand_pwsh():
**os.environ,
"_TUTORIAL001.PY_COMPLETE": "complete_pwsh",
"_TYPER_COMPLETE_ARGS": "tutorial001.py del",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert (
Expand All @@ -164,7 +155,6 @@ def test_completion_complete_subcommand_noshell():
**os.environ,
"_TUTORIAL001.PY_COMPLETE": "complete_noshell",
"_TYPER_COMPLETE_ARGS": "tutorial001.py del",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert ("") in result.stdout
4 changes: 0 additions & 4 deletions tests/test_completion/test_completion_complete_no_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def test_completion_complete_subcommand_zsh():
**os.environ,
"_TUTORIAL002.PY_COMPLETE": "complete_zsh",
"_TYPER_COMPLETE_ARGS": "tutorial002.py ",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "create" in result.stdout
Expand All @@ -31,7 +30,6 @@ def test_completion_complete_subcommand_fish():
"_TUTORIAL002.PY_COMPLETE": "complete_fish",
"_TYPER_COMPLETE_ARGS": "tutorial002.py ",
"_TYPER_COMPLETE_FISH_ACTION": "get-args",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "create\ndelete" in result.stdout
Expand All @@ -46,7 +44,6 @@ def test_completion_complete_subcommand_powershell():
**os.environ,
"_TUTORIAL002.PY_COMPLETE": "complete_powershell",
"_TYPER_COMPLETE_ARGS": "tutorial002.py ",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert ("create::: \ndelete::: ") in result.stdout
Expand All @@ -61,7 +58,6 @@ def test_completion_complete_subcommand_pwsh():
**os.environ,
"_TUTORIAL002.PY_COMPLETE": "complete_pwsh",
"_TYPER_COMPLETE_ARGS": "tutorial002.py ",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert ("create::: \ndelete::: ") in result.stdout
4 changes: 0 additions & 4 deletions tests/test_completion/test_completion_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def test_completion_install_no_shell():
encoding="utf-8",
env={
**os.environ,
"_TYPER_COMPLETE_TESTING": "True",
"_TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION": "True",
},
)
Expand All @@ -48,7 +47,6 @@ def test_completion_install_bash():
encoding="utf-8",
env={
**os.environ,
"_TYPER_COMPLETE_TESTING": "True",
"_TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION": "True",
},
)
Expand Down Expand Up @@ -90,7 +88,6 @@ def test_completion_install_zsh():
encoding="utf-8",
env={
**os.environ,
"_TYPER_COMPLETE_TESTING": "True",
"_TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION": "True",
},
)
Expand Down Expand Up @@ -126,7 +123,6 @@ def test_completion_install_fish():
encoding="utf-8",
env={
**os.environ,
"_TYPER_COMPLETE_TESTING": "True",
"_TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION": "True",
},
)
Expand Down
6 changes: 0 additions & 6 deletions tests/test_completion/test_completion_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def test_completion_show_no_shell():
encoding="utf-8",
env={
**os.environ,
"_TYPER_COMPLETE_TESTING": "True",
"_TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION": "True",
},
)
Expand All @@ -43,7 +42,6 @@ def test_completion_show_bash():
encoding="utf-8",
env={
**os.environ,
"_TYPER_COMPLETE_TESTING": "True",
"_TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION": "True",
},
)
Expand All @@ -68,7 +66,6 @@ def test_completion_source_zsh():
encoding="utf-8",
env={
**os.environ,
"_TYPER_COMPLETE_TESTING": "True",
"_TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION": "True",
},
)
Expand All @@ -90,7 +87,6 @@ def test_completion_source_fish():
encoding="utf-8",
env={
**os.environ,
"_TYPER_COMPLETE_TESTING": "True",
"_TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION": "True",
},
)
Expand All @@ -112,7 +108,6 @@ def test_completion_source_powershell():
encoding="utf-8",
env={
**os.environ,
"_TYPER_COMPLETE_TESTING": "True",
"_TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION": "True",
},
)
Expand All @@ -137,7 +132,6 @@ def test_completion_source_pwsh():
encoding="utf-8",
env={
**os.environ,
"_TYPER_COMPLETE_TESTING": "True",
"_TYPER_COMPLETE_TEST_DISABLE_SHELL_DETECTION": "True",
},
)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_others.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ def test_completion_untyped_parameters():
**os.environ,
"_COMPLETION_NO_TYPES.PY_COMPLETE": "complete_zsh",
"_TYPER_COMPLETE_ARGS": "completion_no_types.py --name Sebastian --name Ca",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "info name is: completion_no_types.py" in result.stderr
Expand All @@ -178,7 +177,6 @@ def test_completion_untyped_parameters_different_order_correct_names():
**os.environ,
"_COMPLETION_NO_TYPES_ORDER.PY_COMPLETE": "complete_zsh",
"_TYPER_COMPLETE_ARGS": "completion_no_types_order.py --name Sebastian --name Ca",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "info name is: completion_no_types_order.py" in result.stderr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def test_completion():
"_TUTORIAL003.PY_COMPLETE": "complete_bash",
"COMP_WORDS": "tutorial003.py --",
"COMP_CWORD": "1",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "--name" in result.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def test_completion():
"_TUTORIAL003_AN.PY_COMPLETE": "complete_bash",
"COMP_WORDS": "tutorial003_an.py --",
"COMP_CWORD": "1",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "--name" in result.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def test_completion():
"_TUTORIAL004.PY_COMPLETE": "complete_bash",
"COMP_WORDS": "tutorial004.py --",
"COMP_CWORD": "1",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "--name" in result.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def test_completion():
"_TUTORIAL004_AN.PY_COMPLETE": "complete_bash",
"COMP_WORDS": "tutorial004_an.py --",
"COMP_CWORD": "1",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "--name" in result.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def test_completion():
"_TUTORIAL003.PY_COMPLETE": "complete_bash",
"COMP_WORDS": "tutorial003.py --name Rick --v",
"COMP_CWORD": "3",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "--version" in result.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def test_completion():
"_TUTORIAL003_AN.PY_COMPLETE": "complete_bash",
"COMP_WORDS": "tutorial003_an.py --name Rick --v",
"COMP_CWORD": "3",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "--version" in result.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def test_completion():
**os.environ,
"_TUTORIAL002.PY_COMPLETE": "complete_zsh",
"_TYPER_COMPLETE_ARGS": "tutorial002.py --name ",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "Camila" in result.stdout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def test_completion():
**os.environ,
"_TUTORIAL002_AN.PY_COMPLETE": "complete_zsh",
"_TYPER_COMPLETE_ARGS": "tutorial002_an.py --name ",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "Camila" in result.stdout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def test_completion():
**os.environ,
"_TUTORIAL003.PY_COMPLETE": "complete_zsh",
"_TYPER_COMPLETE_ARGS": "tutorial003.py --name Seb",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "Camila" not in result.stdout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def test_completion():
**os.environ,
"_TUTORIAL003_AN.PY_COMPLETE": "complete_zsh",
"_TYPER_COMPLETE_ARGS": "tutorial003_an.py --name Seb",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert "Camila" not in result.stdout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def test_completion():
**os.environ,
"_TUTORIAL004.PY_COMPLETE": "complete_zsh",
"_TYPER_COMPLETE_ARGS": "tutorial004_aux.py --name ",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert '"Camila":"The reader of books."' in result.stdout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def test_completion():
**os.environ,
"_TUTORIAL004_AN.PY_COMPLETE": "complete_zsh",
"_TYPER_COMPLETE_ARGS": "tutorial004_an_aux.py --name ",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert '"Camila":"The reader of books."' in result.stdout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def test_completion():
**os.environ,
"_TUTORIAL007.PY_COMPLETE": "complete_zsh",
"_TYPER_COMPLETE_ARGS": "tutorial007.py --name Sebastian --name ",
"_TYPER_COMPLETE_TESTING": "True",
},
)
assert '"Camila":"The reader of books."' in result.stdout
Expand Down
Loading

0 comments on commit 2967b16

Please sign in to comment.