🔧 Migrate from Black, isort, flake8, autoflake, pyupgrade to Ruff (#763)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sebastián Ramírez · committed by GitHub · parent 3eccf5a · Browse files · 243 files·+414 added−643 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
243 files+414 added−643 removed
- tests:+293 added−546 removed
- other:+121 added−97 removed
Provenance
- Commit
38b8e4a- Tree
d54fe77- Author
Sebastián Ramírez <tiangolo@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
3eccf5a
243 files changed+414 added−643 removed
modified:docs_src/arguments/envvar/tutorial002_an.py+1 added-1 removed
1 unmodified line2 from typing_extensions import Annotated3 4 5 def main(6- name: Annotated[str, typer.Argument(envvar=["AWESOME_NAME", "GOD_NAME"])] = "World"6+ name: Annotated[str, typer.Argument(envvar=["AWESOME_NAME", "GOD_NAME"])] = "World",7 ):8 print(f"Hello Mr. {name}")9 10 2 unmodified linesmodified:docs_src/arguments/envvar/tutorial003_an.py+1 added-1 removed
3 unmodified lines4 5 def main(6 name: Annotated[7 str, typer.Argument(envvar="AWESOME_NAME", show_envvar=False)8- ] = "World"8+ ] = "World",9 ):10 print(f"Hello Mr. {name}")11 12 2 unmodified linesmodified:docs_src/arguments/help/tutorial004_an.py+1 added-1 removed
3 unmodified lines4 5 def main(6 name: Annotated[7 str, typer.Argument(help="Who to greet", show_default=False)8- ] = "World"8+ ] = "World",9 ):10 """11 Say hi to NAME very gently, like Dirk.12 """5 unmodified linesmodified:docs_src/arguments/help/tutorial005_an.py+1 added-1 removed
6 unmodified lines7 str,8 typer.Argument(9 help="Who to greet", show_default="Deadpoolio the amazing's name"10 ),11- ] = "Wade Wilson"11+ ] = "Wade Wilson",12 ):13 print(f"Hello {name}")14 15 2 unmodified linesmodified:docs_src/arguments/help/tutorial005.py+1 added-1 removed
2 unmodified lines3 4 def main(5 name: str = typer.Argument(6 "Wade Wilson", help="Who to greet", show_default="Deadpoolio the amazing's name"7- )7+ ),8 ):9 print(f"Hello {name}")10 11 2 unmodified linesmodified:docs_src/commands/help/tutorial001_an.py+1 added-1 removed
40 unmodified lines41 typer.Option(42 prompt="Are you sure you want to delete ALL users?",43 help="Force deletion without confirmation.",44 ),45- ]45+ ],46 ):47 """48 Delete ALL users in the database.49 18 unmodified linesmodified:docs_src/commands/help/tutorial001.py+1 added-1 removed
35 unmodified lines36 force: bool = typer.Option(37 ...,38 prompt="Are you sure you want to delete ALL users?",39 help="Force deletion without confirmation.",40- )40+ ),41 ):42 """43 Delete ALL users in the database.44 18 unmodified linesmodified:docs_src/commands/help/tutorial004_an.py+1 added-1 removed
6 unmodified lines7 @app.command()8 def create(9 username: Annotated[10 str, typer.Argument(help="The username to be [green]created[/green]")11- ]11+ ],12 ):13 """14 [bold green]Create[/bold green] a new [italic]shinny[/italic] user. :sparkles:15 22 unmodified linesmodified:docs_src/commands/help/tutorial004.py+1 added-1 removed
5 unmodified lines6 @app.command()7 def create(8 username: str = typer.Argument(9 ..., help="The username to be [green]created[/green]"10- )10+ ),11 ):12 """13 [bold green]Create[/bold green] a new [italic]shiny[/italic] user. :sparkles:14 20 unmodified linesmodified:docs_src/commands/help/tutorial005_an.py+1 added-1 removed
4 unmodified lines5 6 7 @app.command()8 def create(9- username: Annotated[str, typer.Argument(help="The username to be **created**")]9+ username: Annotated[str, typer.Argument(help="The username to be **created**")],10 ):11 """12 **Create** a new *shinny* user. :sparkles:13 24 unmodified linesmodified:docs_src/commands/options/tutorial001_an.py+1 added-1 removed
24 unmodified lines25 @app.command()26 def delete_all(27 force: Annotated[28 bool, typer.Option(prompt="Are you sure you want to delete ALL users?")29- ]29+ ],30 ):31 if force:32 print("Deleting all users")33 else:10 unmodified linesmodified:docs_src/commands/options/tutorial001.py+3 added-1 removed
19 unmodified lines20 21 22 @app.command()23 def delete_all(24- force: bool = typer.Option(..., prompt="Are you sure you want to delete ALL users?")24+ force: bool = typer.Option(25+ ..., prompt="Are you sure you want to delete ALL users?"26+ ),27 ):28 if force:29 print("Deleting all users")30 else:10 unmodified linesmodified:docs_src/multiple_values/arguments_with_multiple_values/tutorial002_an.py+1 added-1 removed
5 unmodified lines6 7 def main(8 names: Annotated[9 Tuple[str, str, str], typer.Argument(help="Select 3 characters to play with")10- ] = ("Harry", "Hermione", "Ron")10+ ] = ("Harry", "Hermione", "Ron"),11 ):12 for name in names:13 print(f"Hello {name}")14 3 unmodified linesmodified:docs_src/multiple_values/arguments_with_multiple_values/tutorial002.py+1 added-1 removed
4 unmodified lines5 6 def main(7 names: Tuple[str, str, str] = typer.Argument(8 ("Harry", "Hermione", "Ron"), help="Select 3 characters to play with"9- )9+ ),10 ):11 for name in names:12 print(f"Hello {name}")13 3 unmodified linesmodified:docs_src/options/help/tutorial004_an.py+1 added-1 removed
3 unmodified lines4 5 def main(6 fullname: Annotated[7 str, typer.Option(show_default="Deadpoolio the amazing's name")8- ] = "Wade Wilson"8+ ] = "Wade Wilson",9 ):10 print(f"Hello {fullname}")11 12 2 unmodified linesmodified:docs_src/options/help/tutorial004.py+1 added-1 removed
2 unmodified lines3 4 def main(5 fullname: str = typer.Option(6 "Wade Wilson", show_default="Deadpoolio the amazing's name"7- )7+ ),8 ):9 print(f"Hello {fullname}")10 11 2 unmodified linesmodified:docs_src/options/prompt/tutorial003_an.py+1 added-1 removed
1 unmodified line2 from typing_extensions import Annotated3 4 5 def main(6- project_name: Annotated[str, typer.Option(prompt=True, confirmation_prompt=True)]6+ project_name: Annotated[str, typer.Option(prompt=True, confirmation_prompt=True)],7 ):8 print(f"Deleting project {project_name}")9 10 2 unmodified linesmodified:docs_src/options_autocompletion/tutorial002.py+1 added-1 removed
10 unmodified lines11 @app.command()12 def main(13 name: str = typer.Option(14 "World", help="The name to say hi to.", autocompletion=complete_name15- )15+ ),16 ):17 print(f"Hello {name}")18 19 2 unmodified linesmodified:docs_src/options_autocompletion/tutorial003.py+1 added-1 removed
16 unmodified lines17 @app.command()18 def main(19 name: str = typer.Option(20 "World", help="The name to say hi to.", autocompletion=complete_name21- )21+ ),22 ):23 print(f"Hello {name}")24 25 2 unmodified linesmodified:docs_src/options_autocompletion/tutorial004.py+1 added-1 removed
21 unmodified lines22 @app.command()23 def main(24 name: str = typer.Option(25 "World", help="The name to say hi to.", autocompletion=complete_name26- )26+ ),27 ):28 print(f"Hello {name}")29 30 2 unmodified linesmodified:docs_src/options_autocompletion/tutorial005.py+1 added-1 removed
18 unmodified lines19 @app.command()20 def main(21 name: str = typer.Option(22 "World", help="The name to say hi to.", autocompletion=complete_name23- )23+ ),24 ):25 print(f"Hello {name}")26 27 2 unmodified linesmodified:docs_src/options_autocompletion/tutorial006_an.py+1 added-1 removed
6 unmodified lines7 8 9 @app.command()10 def main(11- name: Annotated[List[str], typer.Option(help="The name to say hi to.")] = ["World"]11+ name: Annotated[List[str], typer.Option(help="The name to say hi to.")] = ["World"],12 ):13 for each_name in name:14 print(f"Hello {each_name}")15 3 unmodified linesmodified:docs_src/options_autocompletion/tutorial007.py+1 added-1 removed
21 unmodified lines22 @app.command()23 def main(24 name: List[str] = typer.Option(25 ["World"], help="The name to say hi to.", autocompletion=complete_name26- )26+ ),27 ):28 for n in name:29 print(f"Hello {n}")30 3 unmodified linesmodified:docs_src/options_autocompletion/tutorial008.py+1 added-1 removed
24 unmodified lines25 @app.command()26 def main(27 name: List[str] = typer.Option(28 ["World"], help="The name to say hi to.", autocompletion=complete_name29- )29+ ),30 ):31 for n in name:32 print(f"Hello {n}")33 3 unmodified linesmodified:docs_src/options_autocompletion/tutorial009.py+1 added-1 removed
25 unmodified lines26 @app.command()27 def main(28 name: List[str] = typer.Option(29 ["World"], help="The name to say hi to.", autocompletion=complete_name30- )30+ ),31 ):32 for n in name:33 print(f"Hello {n}")34 3 unmodified linesmodified:docs_src/parameter_types/datetime/tutorial002_an.py+1 added-1 removed
8 unmodified lines9 datetime,10 typer.Argument(11 formats=["%Y-%m-%d", "%Y-%m-%dT%H:%M:%S", "%Y-%m-%d %H:%M:%S", "%m/%d/%Y"]12 ),13- ]13+ ],14 ):15 print(f"Launch will be at: {launch_date}")16 17 2 unmodified linesmodified:docs_src/parameter_types/datetime/tutorial002.py+1 added-1 removed
4 unmodified lines5 6 def main(7 launch_date: datetime = typer.Argument(8 ..., formats=["%Y-%m-%d", "%Y-%m-%dT%H:%M:%S", "%Y-%m-%d %H:%M:%S", "%m/%d/%Y"]9- )9+ ),10 ):11 print(f"Launch will be at: {launch_date}")12 13 2 unmodified linesmodified:docs_src/parameter_types/enum/tutorial002_an.py+1 added-1 removed
11 unmodified lines12 13 def main(14 network: Annotated[15 NeuralNetwork, typer.Option(case_sensitive=False)16- ] = NeuralNetwork.simple16+ ] = NeuralNetwork.simple,17 ):18 print(f"Training neural network of type: {network.value}")19 20 2 unmodified linesmodified:docs_src/parameter_types/enum/tutorial002.py+1 added-1 removed
8 unmodified lines9 lstm = "lstm"10 11 12 def main(13- network: NeuralNetwork = typer.Option(NeuralNetwork.simple, case_sensitive=False)13+ network: NeuralNetwork = typer.Option(NeuralNetwork.simple, case_sensitive=False),14 ):15 print(f"Training neural network of type: {network.value}")16 17 2 unmodified linesmodified:docs_src/parameter_types/path/tutorial002_an.py+1 added-1 removed
13 unmodified lines14 writable=False,15 readable=True,16 resolve_path=True,17 ),18- ]18+ ],19 ):20 text = config.read_text()21 print(f"Config file contents: {text}")22 3 unmodified linesmodified:docs_src/parameter_types/path/tutorial002.py+1 added-1 removed
10 unmodified lines11 dir_okay=False,12 writable=False,13 readable=True,14 resolve_path=True,15- )15+ ),16 ):17 text = config.read_text()18 print(f"Config file contents: {text}")19 3 unmodified linesmodified:scripts/format.sh+3 added-3 removed
1 #!/bin/sh -e2 set -x3+set -e4 4-autoflake --remove-all-unused-imports --recursive --remove-unused-variables --in-place docs_src typer tests --exclude=__init__.py5-black typer tests docs_src6-isort typer tests docs_src5+ruff typer tests docs_src scripts --fix6+ruff format typer tests docs_src scriptsmodified:scripts/lint.sh+2 added-2 removed
2 unmodified lines3 set -e4 set -x5 6 mypy typer7-black typer tests docs_src --check8-isort typer tests docs_src --check-only7+ruff typer tests docs_src scripts8+ruff format typer tests --checkmodified:tests/test_compat/test_option_get_help.py+1 added-2 removed
40 unmodified lines41 42 def test_completion():43 result = subprocess.run(44 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],45- stdout=subprocess.PIPE,46- stderr=subprocess.PIPE,45+ capture_output=True,46 encoding="utf-8",47 env={48 **os.environ,49 "_COMPAT_CLICK7_8.PY_COMPLETE": "complete_zsh",5 unmodified linesmodified:tests/test_completion/test_completion_complete_no_help.py+4 added-8 removed
6 unmodified lines7 8 def test_completion_complete_subcommand_zsh():9 result = subprocess.run(10 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],11- stdout=subprocess.PIPE,12- stderr=subprocess.PIPE,11+ capture_output=True,12 encoding="utf-8",13 env={14 **os.environ,15 "_TUTORIAL002.PY_COMPLETE": "complete_zsh",7 unmodified lines23 24 def test_completion_complete_subcommand_fish():25 result = subprocess.run(26 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],28- stdout=subprocess.PIPE,29- stderr=subprocess.PIPE,27+ capture_output=True,28 encoding="utf-8",29 env={30 **os.environ,31 "_TUTORIAL002.PY_COMPLETE": "complete_fish",7 unmodified lines39 40 def test_completion_complete_subcommand_powershell():41 result = subprocess.run(42 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],45- stdout=subprocess.PIPE,46- stderr=subprocess.PIPE,43+ capture_output=True,44 encoding="utf-8",45 env={46 **os.environ,47 "_TUTORIAL002.PY_COMPLETE": "complete_powershell",6 unmodified lines54 55 def test_completion_complete_subcommand_pwsh():56 result = subprocess.run(57 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],61- stdout=subprocess.PIPE,62- stderr=subprocess.PIPE,58+ capture_output=True,59 encoding="utf-8",60 env={61 **os.environ,62 "_TUTORIAL002.PY_COMPLETE": "complete_pwsh",5 unmodified linesmodified:tests/test_completion/test_completion_complete.py+10 added-20 removed
6 unmodified lines7 8 def test_completion_complete_subcommand_bash():9 result = subprocess.run(10 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],11- stdout=subprocess.PIPE,12- stderr=subprocess.PIPE,11+ capture_output=True,12 encoding="utf-8",13 env={14 **os.environ,15 "_TUTORIAL001.PY_COMPLETE": "complete_bash",7 unmodified lines23 24 def test_completion_complete_subcommand_bash_invalid():25 result = subprocess.run(26 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],28- stdout=subprocess.PIPE,29- stderr=subprocess.PIPE,27+ capture_output=True,28 encoding="utf-8",29 env={30 **os.environ,31 "_TUTORIAL001.PY_COMPLETE": "complete_bash",7 unmodified lines39 40 def test_completion_complete_subcommand_zsh():41 result = subprocess.run(42 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],45- stdout=subprocess.PIPE,46- stderr=subprocess.PIPE,43+ capture_output=True,44 encoding="utf-8",45 env={46 **os.environ,47 "_TUTORIAL001.PY_COMPLETE": "complete_zsh",9 unmodified lines57 58 def test_completion_complete_subcommand_zsh_files():59 result = subprocess.run(60 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],64- stdout=subprocess.PIPE,65- stderr=subprocess.PIPE,61+ capture_output=True,62 encoding="utf-8",63 env={64 **os.environ,65 "_TUTORIAL001.PY_COMPLETE": "complete_zsh",6 unmodified lines72 73 def test_completion_complete_subcommand_fish():74 result = subprocess.run(75 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],80- stdout=subprocess.PIPE,81- stderr=subprocess.PIPE,76+ capture_output=True,77 encoding="utf-8",78 env={79 **os.environ,80 "_TUTORIAL001.PY_COMPLETE": "complete_fish",10 unmodified lines91 92 def test_completion_complete_subcommand_fish_should_complete():93 result = subprocess.run(94 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],100- stdout=subprocess.PIPE,101- stderr=subprocess.PIPE,95+ capture_output=True,96 encoding="utf-8",97 env={98 **os.environ,99 "_TUTORIAL001.PY_COMPLETE": "complete_fish",7 unmodified lines107 108 def test_completion_complete_subcommand_fish_should_complete_no():109 result = subprocess.run(110 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],117- stdout=subprocess.PIPE,118- stderr=subprocess.PIPE,111+ capture_output=True,112 encoding="utf-8",113 env={114 **os.environ,115 "_TUTORIAL001.PY_COMPLETE": "complete_fish",7 unmodified lines123 124 def test_completion_complete_subcommand_powershell():125 result = subprocess.run(126 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],134- stdout=subprocess.PIPE,135- stderr=subprocess.PIPE,127+ capture_output=True,128 encoding="utf-8",129 env={130 **os.environ,131 "_TUTORIAL001.PY_COMPLETE": "complete_powershell",8 unmodified lines140 141 def test_completion_complete_subcommand_pwsh():142 result = subprocess.run(143 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],152- stdout=subprocess.PIPE,153- stderr=subprocess.PIPE,144+ capture_output=True,145 encoding="utf-8",146 env={147 **os.environ,148 "_TUTORIAL001.PY_COMPLETE": "complete_pwsh",8 unmodified lines157 158 def test_completion_complete_subcommand_noshell():159 result = subprocess.run(160 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],170- stdout=subprocess.PIPE,171- stderr=subprocess.PIPE,161+ capture_output=True,162 encoding="utf-8",163 env={164 **os.environ,165 "_TUTORIAL001.PY_COMPLETE": "complete_noshell",5 unmodified linesmodified:tests/test_completion/test_completion_install.py+5 added-9 removed
16 unmodified lines17 18 def test_completion_install_no_shell():19 result = subprocess.run(20 [sys.executable, "-m", "coverage", "run", mod.__file__, "--install-completion"],21- stdout=subprocess.PIPE,22- stderr=subprocess.PIPE,21+ capture_output=True,22 encoding="utf-8",23 env={24 **os.environ,25 "_TYPER_COMPLETE_TESTING": "True",17 unmodified lines43 mod.__file__,44 "--install-completion",45 "bash",46 ],48- stdout=subprocess.PIPE,49- stderr=subprocess.PIPE,47+ capture_output=True,48 encoding="utf-8",49 env={50 **os.environ,51 "_TYPER_COMPLETE_TESTING": "True",33 unmodified lines85 mod.__file__,86 "--install-completion",87 "zsh",88 ],91- stdout=subprocess.PIPE,92- stderr=subprocess.PIPE,89+ capture_output=True,90 encoding="utf-8",91 env={92 **os.environ,93 "_TYPER_COMPLETE_TESTING": "True",27 unmodified lines121 mod.__file__,122 "--install-completion",123 "fish",124 ],128- stdout=subprocess.PIPE,129- stderr=subprocess.PIPE,125+ capture_output=True,126 encoding="utf-8",127 env={128 **os.environ,129 "_TYPER_COMPLETE_TESTING": "True",13 unmodified lines143 144 145 def test_completion_install_powershell():146 completion_path: Path = (151- Path.home() / f".config/powershell/Microsoft.PowerShell_profile.ps1"147+ Path.home() / ".config/powershell/Microsoft.PowerShell_profile.ps1"148 )149 completion_path_bytes = f"{completion_path}\n".encode("windows-1252")150 text = ""151 if completion_path.is_file(): # pragma: nocover23 unmodified linesmodified:tests/test_completion/test_completion_show.py+6 added-12 removed
15 unmodified lines16 17 def test_completion_show_no_shell():18 result = subprocess.run(19 [sys.executable, "-m", "coverage", "run", mod.__file__, "--show-completion"],20- stdout=subprocess.PIPE,21- stderr=subprocess.PIPE,20+ capture_output=True,21 encoding="utf-8",22 env={23 **os.environ,24 "_TYPER_COMPLETE_TESTING": "True",13 unmodified lines38 mod.__file__,39 "--show-completion",40 "bash",41 ],43- stdout=subprocess.PIPE,44- stderr=subprocess.PIPE,42+ capture_output=True,43 encoding="utf-8",44 env={45 **os.environ,46 "_TYPER_COMPLETE_TESTING": "True",16 unmodified lines63 mod.__file__,64 "--show-completion",65 "zsh",66 ],69- stdout=subprocess.PIPE,70- stderr=subprocess.PIPE,67+ capture_output=True,68 encoding="utf-8",69 env={70 **os.environ,71 "_TYPER_COMPLETE_TESTING": "True",13 unmodified lines85 mod.__file__,86 "--show-completion",87 "fish",88 ],92- stdout=subprocess.PIPE,93- stderr=subprocess.PIPE,89+ capture_output=True,90 encoding="utf-8",91 env={92 **os.environ,93 "_TYPER_COMPLETE_TESTING": "True",13 unmodified lines107 mod.__file__,108 "--show-completion",109 "powershell",110 ],115- stdout=subprocess.PIPE,116- stderr=subprocess.PIPE,111+ capture_output=True,112 encoding="utf-8",113 env={114 **os.environ,115 "_TYPER_COMPLETE_TESTING": "True",16 unmodified lines132 mod.__file__,133 "--show-completion",134 "pwsh",135 ],141- stdout=subprocess.PIPE,142- stderr=subprocess.PIPE,136+ capture_output=True,137 encoding="utf-8",138 env={139 **os.environ,140 "_TYPER_COMPLETE_TESTING": "True",15 unmodified linesmodified:tests/test_completion/test_completion.py+10 added-20 removed
11 unmodified lines12 "bash",13 "-c",14 f"{sys.executable} -m coverage run {mod.__file__} --show-completion",15 ],16- stdout=subprocess.PIPE,17- stderr=subprocess.PIPE,16+ capture_output=True,17 encoding="utf-8",18 env={**os.environ, "SHELL": "/bin/bash", "_TYPER_COMPLETE_TESTING": "True"},19 )20 assert "_TUTORIAL001.PY_COMPLETE=complete_bash" in result.stdout9 unmodified lines30 "bash",31 "-c",32 f"{sys.executable} -m coverage run {mod.__file__} --install-completion",33 ],35- stdout=subprocess.PIPE,36- stderr=subprocess.PIPE,34+ capture_output=True,35 encoding="utf-8",36 env={**os.environ, "SHELL": "/bin/bash", "_TYPER_COMPLETE_TESTING": "True"},37 )38 new_text = bash_completion_path.read_text()6 unmodified lines45 46 def test_completion_invalid_instruction():47 result = subprocess.run(48 [sys.executable, "-m", "coverage", "run", mod.__file__],51- stdout=subprocess.PIPE,52- stderr=subprocess.PIPE,49+ capture_output=True,50 encoding="utf-8",51 env={52 **os.environ,53 "_TUTORIAL001.PY_COMPLETE": "sourcebash",6 unmodified lines60 61 def test_completion_source_bash():62 result = subprocess.run(63 [sys.executable, "-m", "coverage", "run", mod.__file__],67- stdout=subprocess.PIPE,68- stderr=subprocess.PIPE,64+ capture_output=True,65 encoding="utf-8",66 env={67 **os.environ,68 "_TUTORIAL001.PY_COMPLETE": "source_bash",8 unmodified lines77 78 def test_completion_source_invalid_shell():79 result = subprocess.run(80 [sys.executable, "-m", "coverage", "run", mod.__file__],85- stdout=subprocess.PIPE,86- stderr=subprocess.PIPE,81+ capture_output=True,82 encoding="utf-8",83 env={84 **os.environ,85 "_TUTORIAL001.PY_COMPLETE": "source_xxx",5 unmodified lines91 92 def test_completion_source_invalid_instruction():93 result = subprocess.run(94 [sys.executable, "-m", "coverage", "run", mod.__file__],100- stdout=subprocess.PIPE,101- stderr=subprocess.PIPE,95+ capture_output=True,96 encoding="utf-8",97 env={98 **os.environ,99 "_TUTORIAL001.PY_COMPLETE": "explode_bash",5 unmodified lines105 106 def test_completion_source_zsh():107 result = subprocess.run(108 [sys.executable, "-m", "coverage", "run", mod.__file__],115- stdout=subprocess.PIPE,116- stderr=subprocess.PIPE,109+ capture_output=True,110 encoding="utf-8",111 env={112 **os.environ,113 "_TUTORIAL001.PY_COMPLETE": "source_zsh",5 unmodified lines119 120 def test_completion_source_fish():121 result = subprocess.run(122 [sys.executable, "-m", "coverage", "run", mod.__file__],130- stdout=subprocess.PIPE,131- stderr=subprocess.PIPE,123+ capture_output=True,124 encoding="utf-8",125 env={126 **os.environ,127 "_TUTORIAL001.PY_COMPLETE": "source_fish",5 unmodified lines133 134 def test_completion_source_powershell():135 result = subprocess.run(136 [sys.executable, "-m", "coverage", "run", mod.__file__],145- stdout=subprocess.PIPE,146- stderr=subprocess.PIPE,137+ capture_output=True,138 encoding="utf-8",139 env={140 **os.environ,141 "_TUTORIAL001.PY_COMPLETE": "source_powershell",8 unmodified lines150 151 def test_completion_source_pwsh():152 result = subprocess.run(153 [sys.executable, "-m", "coverage", "run", mod.__file__],163- stdout=subprocess.PIPE,164- stderr=subprocess.PIPE,154+ capture_output=True,155 encoding="utf-8",156 env={157 **os.environ,158 "_TUTORIAL001.PY_COMPLETE": "source_pwsh",7 unmodified linesmodified:tests/test_tutorial/test_arguments/test_default/test_tutorial001_an.py+1 added-2 removed
33 unmodified lines34 35 def test_script():36 result = subprocess.run(37 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],38- stdout=subprocess.PIPE,39- stderr=subprocess.PIPE,38+ capture_output=True,39 encoding="utf-8",40 )41 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_default/test_tutorial001.py+1 added-2 removed
33 unmodified lines34 35 def test_script():36 result = subprocess.run(37 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],38- stdout=subprocess.PIPE,39- stderr=subprocess.PIPE,38+ capture_output=True,39 encoding="utf-8",40 )41 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_default/test_tutorial002_an.py+2 added-3 removed
20 unmodified lines21 22 23 def test_call_no_arg():24 greetings = ["Hello Deadpool", "Hello Rick", "Hello Morty", "Hello Hiro"]25- for i in range(3):25+ for _i in range(3):26 result = runner.invoke(app)27 assert result.exit_code == 028 assert any(greet in result.output for greet in greetings)29 6 unmodified lines36 37 def test_script():38 result = subprocess.run(39 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],40- stdout=subprocess.PIPE,41- stderr=subprocess.PIPE,40+ capture_output=True,41 encoding="utf-8",42 )43 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_default/test_tutorial002.py+2 added-3 removed
20 unmodified lines21 22 23 def test_call_no_arg():24 greetings = ["Hello Deadpool", "Hello Rick", "Hello Morty", "Hello Hiro"]25- for i in range(3):25+ for _i in range(3):26 result = runner.invoke(app)27 assert result.exit_code == 028 assert any(greet in result.output for greet in greetings)29 6 unmodified lines36 37 def test_script():38 result = subprocess.run(39 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],40- stdout=subprocess.PIPE,41- stderr=subprocess.PIPE,40+ capture_output=True,41 encoding="utf-8",42 )43 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_envvar/test_tutorial001_an.py+1 added-2 removed
53 unmodified lines54 55 def test_script():56 result = subprocess.run(57 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],58- stdout=subprocess.PIPE,59- stderr=subprocess.PIPE,58+ capture_output=True,59 encoding="utf-8",60 )61 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_envvar/test_tutorial001.py+1 added-2 removed
53 unmodified lines54 55 def test_script():56 result = subprocess.run(57 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],58- stdout=subprocess.PIPE,59- stderr=subprocess.PIPE,58+ capture_output=True,59 encoding="utf-8",60 )61 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_envvar/test_tutorial002_an.py+1 added-2 removed
40 unmodified lines41 42 def test_script():43 result = subprocess.run(44 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],45- stdout=subprocess.PIPE,46- stderr=subprocess.PIPE,45+ capture_output=True,46 encoding="utf-8",47 )48 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_envvar/test_tutorial002.py+1 added-2 removed
40 unmodified lines41 42 def test_script():43 result = subprocess.run(44 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],45- stdout=subprocess.PIPE,46- stderr=subprocess.PIPE,45+ capture_output=True,46 encoding="utf-8",47 )48 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_envvar/test_tutorial003_an.py+1 added-2 removed
40 unmodified lines41 42 def test_script():43 result = subprocess.run(44 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],45- stdout=subprocess.PIPE,46- stderr=subprocess.PIPE,45+ capture_output=True,46 encoding="utf-8",47 )48 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_envvar/test_tutorial003.py+1 added-2 removed
40 unmodified lines41 42 def test_script():43 result = subprocess.run(44 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],45- stdout=subprocess.PIPE,46- stderr=subprocess.PIPE,45+ capture_output=True,46 encoding="utf-8",47 )48 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial001_an.py+1 added-2 removed
43 unmodified lines44 45 def test_script():46 result = subprocess.run(47 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],48- stdout=subprocess.PIPE,49- stderr=subprocess.PIPE,48+ capture_output=True,49 encoding="utf-8",50 )51 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial001.py+1 added-2 removed
43 unmodified lines44 45 def test_script():46 result = subprocess.run(47 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],48- stdout=subprocess.PIPE,49- stderr=subprocess.PIPE,48+ capture_output=True,49 encoding="utf-8",50 )51 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial002_an.py+1 added-2 removed
30 unmodified lines31 32 def test_script():33 result = subprocess.run(34 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],35- stdout=subprocess.PIPE,36- stderr=subprocess.PIPE,35+ capture_output=True,36 encoding="utf-8",37 )38 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial002.py+1 added-2 removed
30 unmodified lines31 32 def test_script():33 result = subprocess.run(34 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],35- stdout=subprocess.PIPE,36- stderr=subprocess.PIPE,35+ capture_output=True,36 encoding="utf-8",37 )38 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial003_an.py+1 added-2 removed
30 unmodified lines31 32 def test_script():33 result = subprocess.run(34 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],35- stdout=subprocess.PIPE,36- stderr=subprocess.PIPE,35+ capture_output=True,36 encoding="utf-8",37 )38 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial003.py+1 added-2 removed
30 unmodified lines31 32 def test_script():33 result = subprocess.run(34 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],35- stdout=subprocess.PIPE,36- stderr=subprocess.PIPE,35+ capture_output=True,36 encoding="utf-8",37 )38 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial004_an.py+1 added-2 removed
30 unmodified lines31 32 def test_script():33 result = subprocess.run(34 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],35- stdout=subprocess.PIPE,36- stderr=subprocess.PIPE,35+ capture_output=True,36 encoding="utf-8",37 )38 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial004.py+1 added-2 removed
30 unmodified lines31 32 def test_script():33 result = subprocess.run(34 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],35- stdout=subprocess.PIPE,36- stderr=subprocess.PIPE,35+ capture_output=True,36 encoding="utf-8",37 )38 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial005_an.py+1 added-2 removed
28 unmodified lines29 30 def test_script():31 result = subprocess.run(32 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],33- stdout=subprocess.PIPE,34- stderr=subprocess.PIPE,33+ capture_output=True,34 encoding="utf-8",35 )36 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial005.py+1 added-2 removed
28 unmodified lines29 30 def test_script():31 result = subprocess.run(32 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],33- stdout=subprocess.PIPE,34- stderr=subprocess.PIPE,33+ capture_output=True,34 encoding="utf-8",35 )36 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial006_an.py+1 added-2 removed
28 unmodified lines29 30 def test_script():31 result = subprocess.run(32 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],33- stdout=subprocess.PIPE,34- stderr=subprocess.PIPE,33+ capture_output=True,34 encoding="utf-8",35 )36 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial006.py+1 added-2 removed
28 unmodified lines29 30 def test_script():31 result = subprocess.run(32 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],33- stdout=subprocess.PIPE,34- stderr=subprocess.PIPE,33+ capture_output=True,34 encoding="utf-8",35 )36 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial007_an.py+1 added-2 removed
28 unmodified lines29 30 def test_script():31 result = subprocess.run(32 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],33- stdout=subprocess.PIPE,34- stderr=subprocess.PIPE,33+ capture_output=True,34 encoding="utf-8",35 )36 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial007.py+1 added-2 removed
28 unmodified lines29 30 def test_script():31 result = subprocess.run(32 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],33- stdout=subprocess.PIPE,34- stderr=subprocess.PIPE,33+ capture_output=True,34 encoding="utf-8",35 )36 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial008_an.py+1 added-2 removed
41 unmodified lines42 43 def test_script():44 result = subprocess.run(45 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],46- stdout=subprocess.PIPE,47- stderr=subprocess.PIPE,46+ capture_output=True,47 encoding="utf-8",48 )49 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_help/test_tutorial008.py+1 added-2 removed
41 unmodified lines42 43 def test_script():44 result = subprocess.run(45 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],46- stdout=subprocess.PIPE,47- stderr=subprocess.PIPE,46+ capture_output=True,47 encoding="utf-8",48 )49 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_optional/test_tutorial001_an.py+1 added-2 removed
42 unmodified lines43 44 def test_script():45 result = subprocess.run(46 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],47- stdout=subprocess.PIPE,48- stderr=subprocess.PIPE,47+ capture_output=True,48 encoding="utf-8",49 )50 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_optional/test_tutorial001.py+1 added-2 removed
42 unmodified lines43 44 def test_script():45 result = subprocess.run(46 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],47- stdout=subprocess.PIPE,48- stderr=subprocess.PIPE,47+ capture_output=True,48 encoding="utf-8",49 )50 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_optional/test_tutorial002_an.py+1 added-2 removed
31 unmodified lines32 33 def test_script():34 result = subprocess.run(35 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],36- stdout=subprocess.PIPE,37- stderr=subprocess.PIPE,36+ capture_output=True,37 encoding="utf-8",38 )39 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_optional/test_tutorial002.py+1 added-2 removed
31 unmodified lines32 33 def test_script():34 result = subprocess.run(35 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],36- stdout=subprocess.PIPE,37- stderr=subprocess.PIPE,36+ capture_output=True,37 encoding="utf-8",38 )39 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_arguments/test_optional/test_tutorial003.py+1 added-2 removed
42 unmodified lines43 44 def test_script():45 result = subprocess.run(46 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],47- stdout=subprocess.PIPE,48- stderr=subprocess.PIPE,47+ capture_output=True,48 encoding="utf-8",49 )50 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_arguments/test_tutorial001.py+1 added-2 removed
35 unmodified lines36 37 def test_script():38 result = subprocess.run(39 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],40- stdout=subprocess.PIPE,41- stderr=subprocess.PIPE,40+ capture_output=True,41 encoding="utf-8",42 )43 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_callback/test_tutorial001.py+1 added-2 removed
67 unmodified lines68 69 def test_script():70 result = subprocess.run(71 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],72- stdout=subprocess.PIPE,73- stderr=subprocess.PIPE,72+ capture_output=True,73 encoding="utf-8",74 )75 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_callback/test_tutorial002.py+1 added-2 removed
18 unmodified lines19 20 def test_script():21 result = subprocess.run(22 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],23- stdout=subprocess.PIPE,24- stderr=subprocess.PIPE,23+ capture_output=True,24 encoding="utf-8",25 )26 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_callback/test_tutorial003.py+1 added-2 removed
23 unmodified lines24 25 def test_script():26 result = subprocess.run(27 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],28- stdout=subprocess.PIPE,29- stderr=subprocess.PIPE,28+ capture_output=True,29 encoding="utf-8",30 )31 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_callback/test_tutorial004.py+1 added-2 removed
25 unmodified lines26 27 def test_script():28 result = subprocess.run(29 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],30- stdout=subprocess.PIPE,31- stderr=subprocess.PIPE,30+ capture_output=True,31 encoding="utf-8",32 )33 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_context/test_tutorial001.py+1 added-2 removed
25 unmodified lines26 27 def test_script():28 result = subprocess.run(29 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],30- stdout=subprocess.PIPE,31- stderr=subprocess.PIPE,30+ capture_output=True,31 encoding="utf-8",32 )33 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_context/test_tutorial002.py+1 added-2 removed
31 unmodified lines32 33 def test_script():34 result = subprocess.run(35 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],36- stdout=subprocess.PIPE,37- stderr=subprocess.PIPE,36+ capture_output=True,37 encoding="utf-8",38 )39 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_context/test_tutorial003.py+1 added-2 removed
31 unmodified lines32 33 def test_script():34 result = subprocess.run(35 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],36- stdout=subprocess.PIPE,37- stderr=subprocess.PIPE,36+ capture_output=True,37 encoding="utf-8",38 )39 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_context/test_tutorial004.py+1 added-2 removed
20 unmodified lines21 22 def test_script():23 result = subprocess.run(24 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],25- stdout=subprocess.PIPE,26- stderr=subprocess.PIPE,25+ capture_output=True,26 encoding="utf-8",27 )28 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_help/test_tutorial001_an.py+1 added-2 removed
101 unmodified lines102 103 def test_script():104 result = subprocess.run(105 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],106- stdout=subprocess.PIPE,107- stderr=subprocess.PIPE,106+ capture_output=True,107 encoding="utf-8",108 )109 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_help/test_tutorial001.py+1 added-2 removed
101 unmodified lines102 103 def test_script():104 result = subprocess.run(105 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],106- stdout=subprocess.PIPE,107- stderr=subprocess.PIPE,106+ capture_output=True,107 encoding="utf-8",108 )109 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_help/test_tutorial002.py+1 added-2 removed
48 unmodified lines49 50 def test_script():51 result = subprocess.run(52 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],53- stdout=subprocess.PIPE,54- stderr=subprocess.PIPE,53+ capture_output=True,54 encoding="utf-8",55 )56 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_help/test_tutorial003.py+1 added-2 removed
36 unmodified lines37 38 def test_script():39 result = subprocess.run(40 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],41- stdout=subprocess.PIPE,42- stderr=subprocess.PIPE,41+ capture_output=True,42 encoding="utf-8",43 )44 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_help/test_tutorial004_an.py+1 added-2 removed
51 unmodified lines52 53 def test_script():54 result = subprocess.run(55 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],56- stdout=subprocess.PIPE,57- stderr=subprocess.PIPE,56+ capture_output=True,57 encoding="utf-8",58 )59 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_help/test_tutorial004.py+1 added-2 removed
51 unmodified lines52 53 def test_script():54 result = subprocess.run(55 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],56- stdout=subprocess.PIPE,57- stderr=subprocess.PIPE,56+ capture_output=True,57 encoding="utf-8",58 )59 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_help/test_tutorial005_an.py+1 added-2 removed
52 unmodified lines53 54 def test_script():55 result = subprocess.run(56 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],57- stdout=subprocess.PIPE,58- stderr=subprocess.PIPE,57+ capture_output=True,58 encoding="utf-8",59 )60 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_help/test_tutorial005.py+1 added-2 removed
52 unmodified lines53 54 def test_script():55 result = subprocess.run(56 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],57- stdout=subprocess.PIPE,58- stderr=subprocess.PIPE,57+ capture_output=True,58 encoding="utf-8",59 )60 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_help/test_tutorial006.py+1 added-2 removed
43 unmodified lines44 45 def test_script():46 result = subprocess.run(47 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],48- stdout=subprocess.PIPE,49- stderr=subprocess.PIPE,48+ capture_output=True,49 encoding="utf-8",50 )51 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_help/test_tutorial007_an.py+1 added-2 removed
47 unmodified lines48 49 def test_script():50 result = subprocess.run(51 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],52- stdout=subprocess.PIPE,53- stderr=subprocess.PIPE,52+ capture_output=True,53 encoding="utf-8",54 )55 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_help/test_tutorial007.py+1 added-2 removed
47 unmodified lines48 49 def test_script():50 result = subprocess.run(51 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],52- stdout=subprocess.PIPE,53- stderr=subprocess.PIPE,52+ capture_output=True,53 encoding="utf-8",54 )55 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_help/test_tutorial008.py+1 added-2 removed
24 unmodified lines25 26 def test_script():27 result = subprocess.run(28 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],29- stdout=subprocess.PIPE,30- stderr=subprocess.PIPE,29+ capture_output=True,30 encoding="utf-8",31 )32 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_index/test_tutorial001.py+1 added-2 removed
23 unmodified lines24 25 def test_script():26 result = subprocess.run(27 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],28- stdout=subprocess.PIPE,29- stderr=subprocess.PIPE,28+ capture_output=True,29 encoding="utf-8",30 )31 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_index/test_tutorial002.py+1 added-2 removed
32 unmodified lines33 34 def test_script():35 result = subprocess.run(36 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],37- stdout=subprocess.PIPE,38- stderr=subprocess.PIPE,37+ capture_output=True,38 encoding="utf-8",39 )40 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_index/test_tutorial003.py+1 added-2 removed
32 unmodified lines33 34 def test_script():35 result = subprocess.run(36 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],37- stdout=subprocess.PIPE,38- stderr=subprocess.PIPE,37+ capture_output=True,38 encoding="utf-8",39 )40 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_name/test_tutorial001.py+1 added-2 removed
31 unmodified lines32 33 def test_script():34 result = subprocess.run(35 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],36- stdout=subprocess.PIPE,37- stderr=subprocess.PIPE,36+ capture_output=True,37 encoding="utf-8",38 )39 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_one_or_multiple/test_tutorial001.py+1 added-2 removed
24 unmodified lines25 26 def test_script():27 result = subprocess.run(28 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],29- stdout=subprocess.PIPE,30- stderr=subprocess.PIPE,29+ capture_output=True,30 encoding="utf-8",31 )32 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_one_or_multiple/test_tutorial002.py+1 added-2 removed
26 unmodified lines27 28 def test_script():29 result = subprocess.run(30 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],31- stdout=subprocess.PIPE,32- stderr=subprocess.PIPE,31+ capture_output=True,32 encoding="utf-8",33 )34 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_options/test_tutorial001_an.py+1 added-2 removed
68 unmodified lines69 70 def test_script():71 result = subprocess.run(72 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],73- stdout=subprocess.PIPE,74- stderr=subprocess.PIPE,73+ capture_output=True,74 encoding="utf-8",75 )76 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_commands/test_options/test_tutorial001.py+1 added-2 removed
68 unmodified lines69 70 def test_script():71 result = subprocess.run(72 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],73- stdout=subprocess.PIPE,74- stderr=subprocess.PIPE,73+ capture_output=True,74 encoding="utf-8",75 )76 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_exceptions/test_tutorial001.py+3 added-6 removed
12 unmodified lines13 def test_traceback_rich():14 file_path = Path(mod.__file__)15 result = subprocess.run(16 [sys.executable, "-m", "coverage", "run", str(file_path)],17- stdout=subprocess.PIPE,18- stderr=subprocess.PIPE,17+ capture_output=True,18 encoding="utf-8",19 env={**os.environ, "_TYPER_STANDARD_TRACEBACK": ""},20 )21 assert "return get_command(self)(*args, **kwargs)" not in result.stderr7 unmodified lines29 def test_standard_traceback_env_var():30 file_path = Path(mod.__file__)31 result = subprocess.run(32 [sys.executable, "-m", "coverage", "run", str(file_path)],34- stdout=subprocess.PIPE,35- stderr=subprocess.PIPE,33+ capture_output=True,34 encoding="utf-8",35 env={**os.environ, "_TYPER_STANDARD_TRACEBACK": "1"},36 )37 assert "return get_command(self)(*args, **kwargs)" in result.stderr6 unmodified lines44 45 def test_script():46 result = subprocess.run(47 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],50- stdout=subprocess.PIPE,51- stderr=subprocess.PIPE,48+ capture_output=True,49 encoding="utf-8",50 )51 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_exceptions/test_tutorial002.py+3 added-6 removed
12 unmodified lines13 def test_traceback_rich():14 file_path = Path(mod.__file__)15 result = subprocess.run(16 [sys.executable, "-m", "coverage", "run", str(file_path), "secret"],17- stdout=subprocess.PIPE,18- stderr=subprocess.PIPE,17+ capture_output=True,18 encoding="utf-8",19 env={**os.environ, "_TYPER_STANDARD_TRACEBACK": ""},20 )21 assert "return get_command(self)(*args, **kwargs)" not in result.stderr7 unmodified lines29 def test_standard_traceback_env_var():30 file_path = Path(mod.__file__)31 result = subprocess.run(32 [sys.executable, "-m", "coverage", "run", str(file_path), "secret"],34- stdout=subprocess.PIPE,35- stderr=subprocess.PIPE,33+ capture_output=True,34 encoding="utf-8",35 env={**os.environ, "_TYPER_STANDARD_TRACEBACK": "1"},36 )37 assert "return get_command(self)(*args, **kwargs)" in result.stderr6 unmodified lines44 45 def test_script():46 result = subprocess.run(47 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],50- stdout=subprocess.PIPE,51- stderr=subprocess.PIPE,48+ capture_output=True,49 encoding="utf-8",50 )51 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_exceptions/test_tutorial003.py+2 added-4 removed
12 unmodified lines13 def test_traceback_rich_pretty_short_disable():14 file_path = Path(mod.__file__)15 result = subprocess.run(16 [sys.executable, "-m", "coverage", "run", str(file_path)],17- stdout=subprocess.PIPE,18- stderr=subprocess.PIPE,17+ capture_output=True,18 encoding="utf-8",19 env={**os.environ, "_TYPER_STANDARD_TRACEBACK": ""},20 )21 assert "return get_command(self)(*args, **kwargs)" not in result.stderr6 unmodified lines28 29 def test_script():30 result = subprocess.run(31 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],33- stdout=subprocess.PIPE,34- stderr=subprocess.PIPE,32+ capture_output=True,33 encoding="utf-8",34 )35 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_exceptions/test_tutorial004.py+2 added-4 removed
12 unmodified lines13 def test_rich_pretty_exceptions_disable():14 file_path = Path(mod.__file__)15 result = subprocess.run(16 [sys.executable, "-m", "coverage", "run", str(file_path)],17- stdout=subprocess.PIPE,18- stderr=subprocess.PIPE,17+ capture_output=True,18 encoding="utf-8",19 env={**os.environ, "_TYPER_STANDARD_TRACEBACK": ""},20 )21 assert "return get_command(self)(*args, **kwargs)" in result.stderr5 unmodified lines27 28 def test_script():29 result = subprocess.run(30 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],32- stdout=subprocess.PIPE,33- stderr=subprocess.PIPE,31+ capture_output=True,32 encoding="utf-8",33 )34 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_first_steps/test_tutorial001.py+1 added-2 removed
17 unmodified lines18 19 def test_script():20 result = subprocess.run(21 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],22- stdout=subprocess.PIPE,23- stderr=subprocess.PIPE,22+ capture_output=True,23 encoding="utf-8",24 )25 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_first_steps/test_tutorial002.py+1 added-2 removed
25 unmodified lines26 27 def test_script():28 result = subprocess.run(29 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],30- stdout=subprocess.PIPE,31- stderr=subprocess.PIPE,30+ capture_output=True,31 encoding="utf-8",32 )33 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_first_steps/test_tutorial003.py+1 added-2 removed
25 unmodified lines26 27 def test_script():28 result = subprocess.run(29 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],30- stdout=subprocess.PIPE,31- stderr=subprocess.PIPE,30+ capture_output=True,31 encoding="utf-8",32 )33 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_first_steps/test_tutorial004.py+1 added-2 removed
49 unmodified lines50 51 def test_script():52 result = subprocess.run(53 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],54- stdout=subprocess.PIPE,55- stderr=subprocess.PIPE,54+ capture_output=True,55 encoding="utf-8",56 )57 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_first_steps/test_tutorial005.py+1 added-2 removed
49 unmodified lines50 51 def test_script():52 result = subprocess.run(53 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],54- stdout=subprocess.PIPE,55- stderr=subprocess.PIPE,54+ capture_output=True,55 encoding="utf-8",56 )57 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_first_steps/test_tutorial006.py+1 added-2 removed
44 unmodified lines45 46 def test_script():47 result = subprocess.run(48 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],49- stdout=subprocess.PIPE,50- stderr=subprocess.PIPE,49+ capture_output=True,50 encoding="utf-8",51 )52 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial001.py+1 added-2 removed
19 unmodified lines20 21 def test_script():22 result = subprocess.run(23 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],24- stdout=subprocess.PIPE,25- stderr=subprocess.PIPE,24+ capture_output=True,25 encoding="utf-8",26 )27 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002_an.py+1 added-2 removed
44 unmodified lines45 46 def test_script():47 result = subprocess.run(48 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],49- stdout=subprocess.PIPE,50- stderr=subprocess.PIPE,49+ capture_output=True,50 encoding="utf-8",51 )52 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_multiple_values/test_arguments_with_multiple_values/test_tutorial002.py+1 added-2 removed
42 unmodified lines43 44 def test_script():45 result = subprocess.run(46 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],47- stdout=subprocess.PIPE,48- stderr=subprocess.PIPE,47+ capture_output=True,48 encoding="utf-8",49 )50 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial001_an.py+1 added-2 removed
36 unmodified lines37 38 def test_script():39 result = subprocess.run(40 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],41- stdout=subprocess.PIPE,42- stderr=subprocess.PIPE,41+ capture_output=True,42 encoding="utf-8",43 )44 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial001.py+1 added-2 removed
36 unmodified lines37 38 def test_script():39 result = subprocess.run(40 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],41- stdout=subprocess.PIPE,42- stderr=subprocess.PIPE,41+ capture_output=True,42 encoding="utf-8",43 )44 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial002_an.py+1 added-2 removed
30 unmodified lines31 32 def test_script():33 result = subprocess.run(34 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],35- stdout=subprocess.PIPE,36- stderr=subprocess.PIPE,35+ capture_output=True,36 encoding="utf-8",37 )38 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_multiple_values/test_multiple_options/test_tutorial002.py+1 added-2 removed
30 unmodified lines31 32 def test_script():33 result = subprocess.run(34 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],35- stdout=subprocess.PIPE,36- stderr=subprocess.PIPE,35+ capture_output=True,36 encoding="utf-8",37 )38 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_multiple_values/test_options_with_multiple_values/test_tutorial001_an.py+1 added-2 removed
39 unmodified lines40 41 def test_script():42 result = subprocess.run(43 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],44- stdout=subprocess.PIPE,45- stderr=subprocess.PIPE,44+ capture_output=True,45 encoding="utf-8",46 )47 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_multiple_values/test_options_with_multiple_values/test_tutorial001.py+1 added-2 removed
39 unmodified lines40 41 def test_script():42 result = subprocess.run(43 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],44- stdout=subprocess.PIPE,45- stderr=subprocess.PIPE,44+ capture_output=True,45 encoding="utf-8",46 )47 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_callback/test_tutorial001_an.py+1 added-2 removed
25 unmodified lines26 27 def test_script():28 result = subprocess.run(29 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],30- stdout=subprocess.PIPE,31- stderr=subprocess.PIPE,30+ capture_output=True,31 encoding="utf-8",32 )33 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_callback/test_tutorial001.py+1 added-2 removed
25 unmodified lines26 27 def test_script():28 result = subprocess.run(29 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],30- stdout=subprocess.PIPE,31- stderr=subprocess.PIPE,30+ capture_output=True,31 encoding="utf-8",32 )33 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_callback/test_tutorial003_an.py+2 added-4 removed
27 unmodified lines28 29 def test_script():30 result = subprocess.run(31 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],32- stdout=subprocess.PIPE,33- stderr=subprocess.PIPE,32+ capture_output=True,33 encoding="utf-8",34 )35 assert "Usage" in result.stdout36 37 38 def test_completion():39 result = subprocess.run(40 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],42- stdout=subprocess.PIPE,43- stderr=subprocess.PIPE,41+ capture_output=True,42 encoding="utf-8",43 env={44 **os.environ,45 "_TUTORIAL003_AN.PY_COMPLETE": "complete_bash",6 unmodified linesmodified:tests/test_tutorial/test_options/test_callback/test_tutorial003.py+2 added-4 removed
27 unmodified lines28 29 def test_script():30 result = subprocess.run(31 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],32- stdout=subprocess.PIPE,33- stderr=subprocess.PIPE,32+ capture_output=True,33 encoding="utf-8",34 )35 assert "Usage" in result.stdout36 37 38 def test_completion():39 result = subprocess.run(40 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],42- stdout=subprocess.PIPE,43- stderr=subprocess.PIPE,41+ capture_output=True,42 encoding="utf-8",43 env={44 **os.environ,45 "_TUTORIAL003.PY_COMPLETE": "complete_bash",6 unmodified linesmodified:tests/test_tutorial/test_options/test_callback/test_tutorial004_an.py+2 added-4 removed
27 unmodified lines28 29 def test_script():30 result = subprocess.run(31 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],32- stdout=subprocess.PIPE,33- stderr=subprocess.PIPE,32+ capture_output=True,33 encoding="utf-8",34 )35 assert "Usage" in result.stdout36 37 38 def test_completion():39 result = subprocess.run(40 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],42- stdout=subprocess.PIPE,43- stderr=subprocess.PIPE,41+ capture_output=True,42 encoding="utf-8",43 env={44 **os.environ,45 "_TUTORIAL004_AN.PY_COMPLETE": "complete_bash",6 unmodified linesmodified:tests/test_tutorial/test_options/test_callback/test_tutorial004.py+2 added-4 removed
27 unmodified lines28 29 def test_script():30 result = subprocess.run(31 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],32- stdout=subprocess.PIPE,33- stderr=subprocess.PIPE,32+ capture_output=True,33 encoding="utf-8",34 )35 assert "Usage" in result.stdout36 37 38 def test_completion():39 result = subprocess.run(40 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],42- stdout=subprocess.PIPE,43- stderr=subprocess.PIPE,41+ capture_output=True,42 encoding="utf-8",43 env={44 **os.environ,45 "_TUTORIAL004.PY_COMPLETE": "complete_bash",6 unmodified linesmodified:tests/test_tutorial/test_options/test_help/test_tutorial001_an.py+1 added-2 removed
40 unmodified lines41 42 def test_script():43 result = subprocess.run(44 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],45- stdout=subprocess.PIPE,46- stderr=subprocess.PIPE,45+ capture_output=True,46 encoding="utf-8",47 )48 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_help/test_tutorial001.py+1 added-2 removed
40 unmodified lines41 42 def test_script():43 result = subprocess.run(44 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],45- stdout=subprocess.PIPE,46- stderr=subprocess.PIPE,45+ capture_output=True,46 encoding="utf-8",47 )48 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_help/test_tutorial002_an.py+1 added-2 removed
36 unmodified lines37 38 def test_script():39 result = subprocess.run(40 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],41- stdout=subprocess.PIPE,42- stderr=subprocess.PIPE,41+ capture_output=True,42 encoding="utf-8",43 )44 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_help/test_tutorial002.py+1 added-2 removed
36 unmodified lines37 38 def test_script():39 result = subprocess.run(40 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],41- stdout=subprocess.PIPE,42- stderr=subprocess.PIPE,41+ capture_output=True,42 encoding="utf-8",43 )44 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_help/test_tutorial003_an.py+1 added-2 removed
27 unmodified lines28 29 def test_script():30 result = subprocess.run(31 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],32- stdout=subprocess.PIPE,33- stderr=subprocess.PIPE,32+ capture_output=True,33 encoding="utf-8",34 )35 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_help/test_tutorial003.py+1 added-2 removed
27 unmodified lines28 29 def test_script():30 result = subprocess.run(31 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],32- stdout=subprocess.PIPE,33- stderr=subprocess.PIPE,32+ capture_output=True,33 encoding="utf-8",34 )35 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_name/test_tutorial001_an.py+1 added-2 removed
33 unmodified lines34 35 def test_script():36 result = subprocess.run(37 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],38- stdout=subprocess.PIPE,39- stderr=subprocess.PIPE,38+ capture_output=True,39 encoding="utf-8",40 )41 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_name/test_tutorial001.py+1 added-2 removed
33 unmodified lines34 35 def test_script():36 result = subprocess.run(37 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],38- stdout=subprocess.PIPE,39- stderr=subprocess.PIPE,38+ capture_output=True,39 encoding="utf-8",40 )41 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_name/test_tutorial002_an.py+1 added-2 removed
34 unmodified lines35 36 def test_script():37 result = subprocess.run(38 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,39+ capture_output=True,40 encoding="utf-8",41 )42 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_name/test_tutorial002.py+1 added-2 removed
34 unmodified lines35 36 def test_script():37 result = subprocess.run(38 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,39+ capture_output=True,40 encoding="utf-8",41 )42 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_name/test_tutorial003_an.py+1 added-2 removed
28 unmodified lines29 30 def test_script():31 result = subprocess.run(32 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],33- stdout=subprocess.PIPE,34- stderr=subprocess.PIPE,33+ capture_output=True,34 encoding="utf-8",35 )36 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_name/test_tutorial003.py+1 added-2 removed
28 unmodified lines29 30 def test_script():31 result = subprocess.run(32 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],33- stdout=subprocess.PIPE,34- stderr=subprocess.PIPE,33+ capture_output=True,34 encoding="utf-8",35 )36 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_name/test_tutorial004_an.py+1 added-2 removed
34 unmodified lines35 36 def test_script():37 result = subprocess.run(38 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,39+ capture_output=True,40 encoding="utf-8",41 )42 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_name/test_tutorial004.py+1 added-2 removed
34 unmodified lines35 36 def test_script():37 result = subprocess.run(38 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,39+ capture_output=True,40 encoding="utf-8",41 )42 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_name/test_tutorial005_an.py+1 added-2 removed
46 unmodified lines47 48 def test_script():49 result = subprocess.run(50 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],51- stdout=subprocess.PIPE,52- stderr=subprocess.PIPE,51+ capture_output=True,52 encoding="utf-8",53 )54 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_name/test_tutorial005.py+1 added-2 removed
46 unmodified lines47 48 def test_script():49 result = subprocess.run(50 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],51- stdout=subprocess.PIPE,52- stderr=subprocess.PIPE,51+ capture_output=True,52 encoding="utf-8",53 )54 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_prompt/test_tutorial001_an.py+1 added-2 removed
34 unmodified lines35 36 def test_script():37 result = subprocess.run(38 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,39+ capture_output=True,40 encoding="utf-8",41 )42 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_prompt/test_tutorial001.py+1 added-2 removed
34 unmodified lines35 36 def test_script():37 result = subprocess.run(38 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,39+ capture_output=True,40 encoding="utf-8",41 )42 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_prompt/test_tutorial002_an.py+1 added-2 removed
34 unmodified lines35 36 def test_script():37 result = subprocess.run(38 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,39+ capture_output=True,40 encoding="utf-8",41 )42 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_prompt/test_tutorial002.py+1 added-2 removed
34 unmodified lines35 36 def test_script():37 result = subprocess.run(38 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,39+ capture_output=True,40 encoding="utf-8",41 )42 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_prompt/test_tutorial003_an.py+1 added-2 removed
43 unmodified lines44 45 def test_script():46 result = subprocess.run(47 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],48- stdout=subprocess.PIPE,49- stderr=subprocess.PIPE,48+ capture_output=True,49 encoding="utf-8",50 )51 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_prompt/test_tutorial003.py+1 added-2 removed
43 unmodified lines44 45 def test_script():46 result = subprocess.run(47 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],48- stdout=subprocess.PIPE,49- stderr=subprocess.PIPE,48+ capture_output=True,49 encoding="utf-8",50 )51 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_required/test_tutorial001_an.py+1 added-2 removed
45 unmodified lines46 47 def test_script():48 result = subprocess.run(49 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],50- stdout=subprocess.PIPE,51- stderr=subprocess.PIPE,50+ capture_output=True,51 encoding="utf-8",52 )53 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_required/test_tutorial001.py+1 added-2 removed
45 unmodified lines46 47 def test_script():48 result = subprocess.run(49 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],50- stdout=subprocess.PIPE,51- stderr=subprocess.PIPE,50+ capture_output=True,51 encoding="utf-8",52 )53 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options/test_version/test_tutorial003_an.py+2 added-4 removed
32 unmodified lines33 34 def test_script():35 result = subprocess.run(36 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],37- stdout=subprocess.PIPE,38- stderr=subprocess.PIPE,37+ capture_output=True,38 encoding="utf-8",39 )40 assert "Usage" in result.stdout41 42 43 def test_completion():44 result = subprocess.run(45 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],47- stdout=subprocess.PIPE,48- stderr=subprocess.PIPE,46+ capture_output=True,47 encoding="utf-8",48 env={49 **os.environ,50 "_TUTORIAL003_AN.PY_COMPLETE": "complete_bash",6 unmodified linesmodified:tests/test_tutorial/test_options/test_version/test_tutorial003.py+2 added-4 removed
32 unmodified lines33 34 def test_script():35 result = subprocess.run(36 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],37- stdout=subprocess.PIPE,38- stderr=subprocess.PIPE,37+ capture_output=True,38 encoding="utf-8",39 )40 assert "Usage" in result.stdout41 42 43 def test_completion():44 result = subprocess.run(45 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],47- stdout=subprocess.PIPE,48- stderr=subprocess.PIPE,46+ capture_output=True,47 encoding="utf-8",48 env={49 **os.environ,50 "_TUTORIAL003.PY_COMPLETE": "complete_bash",6 unmodified linesmodified:tests/test_tutorial/test_options_autocompletion/test_tutorial002_an.py+2 added-4 removed
10 unmodified lines11 12 def test_completion():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 env={18 **os.environ,19 "_TUTORIAL002_AN.PY_COMPLETE": "complete_zsh",14 unmodified lines34 35 def test_script():36 result = subprocess.run(37 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,38+ capture_output=True,39 encoding="utf-8",40 )41 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options_autocompletion/test_tutorial002.py+2 added-4 removed
10 unmodified lines11 12 def test_completion():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 env={18 **os.environ,19 "_TUTORIAL002.PY_COMPLETE": "complete_zsh",14 unmodified lines34 35 def test_script():36 result = subprocess.run(37 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,38+ capture_output=True,39 encoding="utf-8",40 )41 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options_autocompletion/test_tutorial003_an.py+2 added-4 removed
10 unmodified lines11 12 def test_completion():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 env={18 **os.environ,19 "_TUTORIAL003_AN.PY_COMPLETE": "complete_zsh",14 unmodified lines34 35 def test_script():36 result = subprocess.run(37 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,38+ capture_output=True,39 encoding="utf-8",40 )41 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options_autocompletion/test_tutorial003.py+2 added-4 removed
10 unmodified lines11 12 def test_completion():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 env={18 **os.environ,19 "_TUTORIAL003.PY_COMPLETE": "complete_zsh",14 unmodified lines34 35 def test_script():36 result = subprocess.run(37 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,38+ capture_output=True,39 encoding="utf-8",40 )41 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options_autocompletion/test_tutorial004_an.py+2 added-4 removed
10 unmodified lines11 12 def test_completion():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 env={18 **os.environ,19 "_TUTORIAL004_AN.PY_COMPLETE": "complete_zsh",14 unmodified lines34 35 def test_script():36 result = subprocess.run(37 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,38+ capture_output=True,39 encoding="utf-8",40 )41 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options_autocompletion/test_tutorial004.py+2 added-4 removed
10 unmodified lines11 12 def test_completion():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 env={18 **os.environ,19 "_TUTORIAL004.PY_COMPLETE": "complete_zsh",14 unmodified lines34 35 def test_script():36 result = subprocess.run(37 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,38+ capture_output=True,39 encoding="utf-8",40 )41 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options_autocompletion/test_tutorial007_an.py+2 added-4 removed
10 unmodified lines11 12 def test_completion():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 env={18 **os.environ,19 "_TUTORIAL007_AN.PY_COMPLETE": "complete_zsh",15 unmodified lines35 36 def test_script():37 result = subprocess.run(38 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],40- stdout=subprocess.PIPE,41- stderr=subprocess.PIPE,39+ capture_output=True,40 encoding="utf-8",41 )42 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options_autocompletion/test_tutorial007.py+2 added-4 removed
10 unmodified lines11 12 def test_completion():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 env={18 **os.environ,19 "_TUTORIAL007.PY_COMPLETE": "complete_zsh",15 unmodified lines35 36 def test_script():37 result = subprocess.run(38 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],40- stdout=subprocess.PIPE,41- stderr=subprocess.PIPE,39+ capture_output=True,40 encoding="utf-8",41 )42 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options_autocompletion/test_tutorial008_an.py+2 added-4 removed
10 unmodified lines11 12 def test_completion():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 env={18 **os.environ,19 "_TUTORIAL008_AN.PY_COMPLETE": "complete_zsh",16 unmodified lines36 37 def test_script():38 result = subprocess.run(39 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],41- stdout=subprocess.PIPE,42- stderr=subprocess.PIPE,40+ capture_output=True,41 encoding="utf-8",42 )43 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options_autocompletion/test_tutorial008.py+2 added-4 removed
10 unmodified lines11 12 def test_completion():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 env={18 **os.environ,19 "_TUTORIAL008.PY_COMPLETE": "complete_zsh",16 unmodified lines36 37 def test_script():38 result = subprocess.run(39 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],41- stdout=subprocess.PIPE,42- stderr=subprocess.PIPE,40+ capture_output=True,41 encoding="utf-8",42 )43 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options_autocompletion/test_tutorial009_an.py+2 added-4 removed
10 unmodified lines11 12 def test_completion():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 env={18 **os.environ,19 "_TUTORIAL009_AN.PY_COMPLETE": "complete_zsh",16 unmodified lines36 37 def test_script():38 result = subprocess.run(39 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],41- stdout=subprocess.PIPE,42- stderr=subprocess.PIPE,40+ capture_output=True,41 encoding="utf-8",42 )43 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_options_autocompletion/test_tutorial009.py+2 added-4 removed
10 unmodified lines11 12 def test_completion():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 env={18 **os.environ,19 "_TUTORIAL009.PY_COMPLETE": "complete_zsh",16 unmodified lines36 37 def test_script():38 result = subprocess.run(39 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],41- stdout=subprocess.PIPE,42- stderr=subprocess.PIPE,40+ capture_output=True,41 encoding="utf-8",42 )43 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_bool/test_tutorial001_an.py+1 added-2 removed
38 unmodified lines39 40 def test_script():41 result = subprocess.run(42 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],43- stdout=subprocess.PIPE,44- stderr=subprocess.PIPE,43+ capture_output=True,44 encoding="utf-8",45 )46 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_bool/test_tutorial001.py+1 added-2 removed
38 unmodified lines39 40 def test_script():41 result = subprocess.run(42 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],43- stdout=subprocess.PIPE,44- stderr=subprocess.PIPE,43+ capture_output=True,44 encoding="utf-8",45 )46 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_bool/test_tutorial002_an.py+1 added-2 removed
57 unmodified lines58 59 def test_script():60 result = subprocess.run(61 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],62- stdout=subprocess.PIPE,63- stderr=subprocess.PIPE,62+ capture_output=True,63 encoding="utf-8",64 )65 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_bool/test_tutorial002.py+1 added-2 removed
57 unmodified lines58 59 def test_script():60 result = subprocess.run(61 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],62- stdout=subprocess.PIPE,63- stderr=subprocess.PIPE,62+ capture_output=True,63 encoding="utf-8",64 )65 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_bool/test_tutorial003_an.py+1 added-2 removed
34 unmodified lines35 36 def test_script():37 result = subprocess.run(38 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,39+ capture_output=True,40 encoding="utf-8",41 )42 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_bool/test_tutorial003.py+1 added-2 removed
34 unmodified lines35 36 def test_script():37 result = subprocess.run(38 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],39- stdout=subprocess.PIPE,40- stderr=subprocess.PIPE,39+ capture_output=True,40 encoding="utf-8",41 )42 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_bool/test_tutorial004_an.py+1 added-2 removed
38 unmodified lines39 40 def test_script():41 result = subprocess.run(42 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],43- stdout=subprocess.PIPE,44- stderr=subprocess.PIPE,43+ capture_output=True,44 encoding="utf-8",45 )46 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_bool/test_tutorial004.py+1 added-2 removed
38 unmodified lines39 40 def test_script():41 result = subprocess.run(42 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],43- stdout=subprocess.PIPE,44- stderr=subprocess.PIPE,43+ capture_output=True,44 encoding="utf-8",45 )46 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial001_an.py+1 added-2 removed
30 unmodified lines31 32 def test_script():33 result = subprocess.run(34 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],35- stdout=subprocess.PIPE,36- stderr=subprocess.PIPE,35+ capture_output=True,36 encoding="utf-8",37 )38 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial001.py+1 added-2 removed
30 unmodified lines31 32 def test_script():33 result = subprocess.run(34 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],35- stdout=subprocess.PIPE,36- stderr=subprocess.PIPE,35+ capture_output=True,36 encoding="utf-8",37 )38 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial002_an.py+1 added-2 removed
30 unmodified lines31 32 def test_script():33 result = subprocess.run(34 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],35- stdout=subprocess.PIPE,36- stderr=subprocess.PIPE,35+ capture_output=True,36 encoding="utf-8",37 )38 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_custom_types/test_tutorial002.py+1 added-2 removed
30 unmodified lines31 32 def test_script():33 result = subprocess.run(34 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],35- stdout=subprocess.PIPE,36- stderr=subprocess.PIPE,35+ capture_output=True,36 encoding="utf-8",37 )38 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial001.py+1 added-2 removed
39 unmodified lines40 41 def test_script():42 result = subprocess.run(43 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],44- stdout=subprocess.PIPE,45- stderr=subprocess.PIPE,44+ capture_output=True,45 encoding="utf-8",46 )47 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial002_an.py+1 added-2 removed
25 unmodified lines26 27 def test_script():28 result = subprocess.run(29 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],30- stdout=subprocess.PIPE,31- stderr=subprocess.PIPE,30+ capture_output=True,31 encoding="utf-8",32 )33 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_datetime/test_tutorial002.py+1 added-2 removed
25 unmodified lines26 27 def test_script():28 result = subprocess.run(29 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],30- stdout=subprocess.PIPE,31- stderr=subprocess.PIPE,30+ capture_output=True,31 encoding="utf-8",32 )33 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_enum/test_tutorial001.py+1 added-2 removed
45 unmodified lines46 47 def test_script():48 result = subprocess.run(49 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],50- stdout=subprocess.PIPE,51- stderr=subprocess.PIPE,50+ capture_output=True,51 encoding="utf-8",52 )53 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_enum/test_tutorial002_an.py+1 added-2 removed
25 unmodified lines26 27 def test_script():28 result = subprocess.run(29 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],30- stdout=subprocess.PIPE,31- stderr=subprocess.PIPE,30+ capture_output=True,31 encoding="utf-8",32 )33 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_enum/test_tutorial002.py+1 added-2 removed
25 unmodified lines26 27 def test_script():28 result = subprocess.run(29 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],30- stdout=subprocess.PIPE,31- stderr=subprocess.PIPE,30+ capture_output=True,31 encoding="utf-8",32 )33 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_enum/test_tutorial003_an.py+1 added-2 removed
39 unmodified lines40 41 def test_script():42 result = subprocess.run(43 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],44- stdout=subprocess.PIPE,45- stderr=subprocess.PIPE,44+ capture_output=True,45 encoding="utf-8",46 )47 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_enum/test_tutorial003.py+1 added-2 removed
39 unmodified lines40 41 def test_script():42 result = subprocess.run(43 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],44- stdout=subprocess.PIPE,45- stderr=subprocess.PIPE,44+ capture_output=True,45 encoding="utf-8",46 )47 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_file/test_tutorial001_an.py+1 added-2 removed
24 unmodified lines25 26 def test_script():27 result = subprocess.run(28 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],29- stdout=subprocess.PIPE,30- stderr=subprocess.PIPE,29+ capture_output=True,30 encoding="utf-8",31 )32 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_file/test_tutorial001.py+1 added-2 removed
24 unmodified lines25 26 def test_script():27 result = subprocess.run(28 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],29- stdout=subprocess.PIPE,30- stderr=subprocess.PIPE,29+ capture_output=True,30 encoding="utf-8",31 )32 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_file/test_tutorial002_an.py+1 added-2 removed
26 unmodified lines27 28 def test_script():29 result = subprocess.run(30 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],31- stdout=subprocess.PIPE,32- stderr=subprocess.PIPE,31+ capture_output=True,32 encoding="utf-8",33 )34 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_file/test_tutorial002.py+1 added-2 removed
26 unmodified lines27 28 def test_script():29 result = subprocess.run(30 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],31- stdout=subprocess.PIPE,32- stderr=subprocess.PIPE,31+ capture_output=True,32 encoding="utf-8",33 )34 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_file/test_tutorial003_an.py+1 added-2 removed
23 unmodified lines24 25 def test_script():26 result = subprocess.run(27 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],28- stdout=subprocess.PIPE,29- stderr=subprocess.PIPE,28+ capture_output=True,29 encoding="utf-8",30 )31 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_file/test_tutorial003.py+1 added-2 removed
23 unmodified lines24 25 def test_script():26 result = subprocess.run(27 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],28- stdout=subprocess.PIPE,29- stderr=subprocess.PIPE,28+ capture_output=True,29 encoding="utf-8",30 )31 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_file/test_tutorial004_an.py+1 added-2 removed
27 unmodified lines28 29 def test_script():30 result = subprocess.run(31 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],32- stdout=subprocess.PIPE,33- stderr=subprocess.PIPE,32+ capture_output=True,33 encoding="utf-8",34 )35 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_file/test_tutorial004.py+1 added-2 removed
27 unmodified lines28 29 def test_script():30 result = subprocess.run(31 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],32- stdout=subprocess.PIPE,33- stderr=subprocess.PIPE,32+ capture_output=True,33 encoding="utf-8",34 )35 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_file/test_tutorial005_an.py+1 added-2 removed
29 unmodified lines30 31 def test_script():32 result = subprocess.run(33 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],34- stdout=subprocess.PIPE,35- stderr=subprocess.PIPE,34+ capture_output=True,35 encoding="utf-8",36 )37 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_file/test_tutorial005.py+1 added-2 removed
29 unmodified lines30 31 def test_script():32 result = subprocess.run(33 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],34- stdout=subprocess.PIPE,35- stderr=subprocess.PIPE,34+ capture_output=True,35 encoding="utf-8",36 )37 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_index/test_tutorial001.py+1 added-2 removed
39 unmodified lines40 41 def test_script():42 result = subprocess.run(43 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],44- stdout=subprocess.PIPE,45- stderr=subprocess.PIPE,44+ capture_output=True,45 encoding="utf-8",46 )47 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_number/test_tutorial001_an.py+1 added-2 removed
74 unmodified lines75 76 def test_script():77 result = subprocess.run(78 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],79- stdout=subprocess.PIPE,80- stderr=subprocess.PIPE,79+ capture_output=True,80 encoding="utf-8",81 )82 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_number/test_tutorial001.py+1 added-2 removed
74 unmodified lines75 76 def test_script():77 result = subprocess.run(78 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],79- stdout=subprocess.PIPE,80- stderr=subprocess.PIPE,79+ capture_output=True,80 encoding="utf-8",81 )82 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_number/test_tutorial002_an.py+1 added-2 removed
29 unmodified lines30 31 def test_script():32 result = subprocess.run(33 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],34- stdout=subprocess.PIPE,35- stderr=subprocess.PIPE,34+ capture_output=True,35 encoding="utf-8",36 )37 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_number/test_tutorial002.py+1 added-2 removed
29 unmodified lines30 31 def test_script():32 result = subprocess.run(33 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],34- stdout=subprocess.PIPE,35- stderr=subprocess.PIPE,34+ capture_output=True,35 encoding="utf-8",36 )37 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_number/test_tutorial003_an.py+1 added-2 removed
49 unmodified lines50 51 def test_script():52 result = subprocess.run(53 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],54- stdout=subprocess.PIPE,55- stderr=subprocess.PIPE,54+ capture_output=True,55 encoding="utf-8",56 )57 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_number/test_tutorial003.py+1 added-2 removed
49 unmodified lines50 51 def test_script():52 result = subprocess.run(53 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],54- stdout=subprocess.PIPE,55- stderr=subprocess.PIPE,54+ capture_output=True,55 encoding="utf-8",56 )57 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_path/test_tutorial001_an.py+1 added-2 removed
46 unmodified lines47 48 def test_script():49 result = subprocess.run(50 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],51- stdout=subprocess.PIPE,52- stderr=subprocess.PIPE,51+ capture_output=True,52 encoding="utf-8",53 )54 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_path/test_tutorial001.py+1 added-2 removed
46 unmodified lines47 48 def test_script():49 result = subprocess.run(50 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],51- stdout=subprocess.PIPE,52- stderr=subprocess.PIPE,51+ capture_output=True,52 encoding="utf-8",53 )54 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_path/test_tutorial002_an.py+1 added-2 removed
39 unmodified lines40 41 def test_script():42 result = subprocess.run(43 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],44- stdout=subprocess.PIPE,45- stderr=subprocess.PIPE,44+ capture_output=True,45 encoding="utf-8",46 )47 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_path/test_tutorial002.py+1 added-2 removed
39 unmodified lines40 41 def test_script():42 result = subprocess.run(43 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],44- stdout=subprocess.PIPE,45- stderr=subprocess.PIPE,44+ capture_output=True,45 encoding="utf-8",46 )47 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_parameter_types/test_uuid/test_tutorial001.py+1 added-2 removed
29 unmodified lines30 31 def test_script():32 result = subprocess.run(33 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],34- stdout=subprocess.PIPE,35- stderr=subprocess.PIPE,34+ capture_output=True,35 encoding="utf-8",36 )37 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_prompt/test_tutorial001.py+1 added-2 removed
20 unmodified lines21 22 def test_script():23 result = subprocess.run(24 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],25- stdout=subprocess.PIPE,26- stderr=subprocess.PIPE,25+ capture_output=True,26 encoding="utf-8",27 )28 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_prompt/test_tutorial002.py+1 added-2 removed
28 unmodified lines29 30 def test_script():31 result = subprocess.run(32 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],33- stdout=subprocess.PIPE,34- stderr=subprocess.PIPE,33+ capture_output=True,34 encoding="utf-8",35 )36 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_prompt/test_tutorial003.py+1 added-2 removed
27 unmodified lines28 29 def test_script():30 result = subprocess.run(31 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],32- stdout=subprocess.PIPE,33- stderr=subprocess.PIPE,32+ capture_output=True,33 encoding="utf-8",34 )35 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial001.py+1 added-2 removed
18 unmodified lines19 20 def test_script():21 result = subprocess.run(22 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],23- stdout=subprocess.PIPE,24- stderr=subprocess.PIPE,23+ capture_output=True,24 encoding="utf-8",25 )26 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial002.py+1 added-2 removed
18 unmodified lines19 20 def test_script():21 result = subprocess.run(22 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],23- stdout=subprocess.PIPE,24- stderr=subprocess.PIPE,23+ capture_output=True,24 encoding="utf-8",25 )26 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial003.py+1 added-2 removed
23 unmodified lines24 25 def test_script():26 result = subprocess.run(27 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],28- stdout=subprocess.PIPE,29- stderr=subprocess.PIPE,28+ capture_output=True,29 encoding="utf-8",30 )31 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_subcommands/test_callback_override/test_tutorial004.py+1 added-2 removed
25 unmodified lines26 27 def test_script():28 result = subprocess.run(29 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],30- stdout=subprocess.PIPE,31- stderr=subprocess.PIPE,30+ capture_output=True,31 encoding="utf-8",32 )33 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_subcommands/test_name_help/test_tutorial001.py+1 added-2 removed
31 unmodified lines32 33 def test_script():34 result = subprocess.run(35 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],36- stdout=subprocess.PIPE,37- stderr=subprocess.PIPE,36+ capture_output=True,37 encoding="utf-8",38 )39 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_subcommands/test_name_help/test_tutorial002.py+1 added-2 removed
31 unmodified lines32 33 def test_script():34 result = subprocess.run(35 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],36- stdout=subprocess.PIPE,37- stderr=subprocess.PIPE,36+ capture_output=True,37 encoding="utf-8",38 )39 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_subcommands/test_name_help/test_tutorial003.py+1 added-2 removed
31 unmodified lines32 33 def test_script():34 result = subprocess.run(35 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],36- stdout=subprocess.PIPE,37- stderr=subprocess.PIPE,36+ capture_output=True,37 encoding="utf-8",38 )39 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_subcommands/test_name_help/test_tutorial004.py+1 added-2 removed
31 unmodified lines32 33 def test_script():34 result = subprocess.run(35 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],36- stdout=subprocess.PIPE,37- stderr=subprocess.PIPE,36+ capture_output=True,37 encoding="utf-8",38 )39 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_subcommands/test_name_help/test_tutorial005.py+1 added-2 removed
31 unmodified lines32 33 def test_script():34 result = subprocess.run(35 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],36- stdout=subprocess.PIPE,37- stderr=subprocess.PIPE,36+ capture_output=True,37 encoding="utf-8",38 )39 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_subcommands/test_name_help/test_tutorial006.py+1 added-2 removed
31 unmodified lines32 33 def test_script():34 result = subprocess.run(35 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],36- stdout=subprocess.PIPE,37- stderr=subprocess.PIPE,36+ capture_output=True,37 encoding="utf-8",38 )39 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_subcommands/test_name_help/test_tutorial007.py+1 added-2 removed
31 unmodified lines32 33 def test_script():34 result = subprocess.run(35 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],36- stdout=subprocess.PIPE,37- stderr=subprocess.PIPE,36+ capture_output=True,37 encoding="utf-8",38 )39 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_subcommands/test_name_help/test_tutorial008.py+1 added-2 removed
31 unmodified lines32 33 def test_script():34 result = subprocess.run(35 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],36- stdout=subprocess.PIPE,37- stderr=subprocess.PIPE,36+ capture_output=True,37 encoding="utf-8",38 )39 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_subcommands/test_tutorial001.py+2 added-3 removed
10 unmodified lines11 12 13 @pytest.fixture()14 def mod(monkeypatch):15- with monkeypatch.context() as m:15+ with monkeypatch.context():16 monkeypatch.syspath_prepend(list(tutorial001.__path__)[0])17 from docs_src.subcommands.tutorial001 import main18 19 return main71 unmodified lines91 92 for module in [mod, items, users]:93 result = subprocess.run(94 [sys.executable, "-m", "coverage", "run", module.__file__, "--help"],95- stdout=subprocess.PIPE,96- stderr=subprocess.PIPE,95+ capture_output=True,96 encoding="utf-8",97 env=env,98 )99 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_subcommands/test_tutorial002.py+1 added-2 removed
69 unmodified lines70 71 def test_script():72 result = subprocess.run(73 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],74- stdout=subprocess.PIPE,75- stderr=subprocess.PIPE,74+ capture_output=True,75 encoding="utf-8",76 )77 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_subcommands/test_tutorial003.py+1 added-2 removed
163 unmodified lines164 165 for module in [mod, items, lands, reigns, towns, users]:166 result = subprocess.run(167 [sys.executable, "-m", "coverage", "run", module.__file__, "--help"],168- stdout=subprocess.PIPE,169- stderr=subprocess.PIPE,168+ capture_output=True,169 encoding="utf-8",170 env=env,171 )172 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_terminating/test_tutorial001.py+1 added-2 removed
35 unmodified lines36 37 def test_script():38 result = subprocess.run(39 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],40- stdout=subprocess.PIPE,41- stderr=subprocess.PIPE,40+ capture_output=True,41 encoding="utf-8",42 )43 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_terminating/test_tutorial002.py+1 added-2 removed
25 unmodified lines26 27 def test_script():28 result = subprocess.run(29 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],30- stdout=subprocess.PIPE,31- stderr=subprocess.PIPE,30+ capture_output=True,31 encoding="utf-8",32 )33 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_terminating/test_tutorial003.py+1 added-2 removed
44 unmodified lines45 46 def test_script():47 result = subprocess.run(48 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],49- stdout=subprocess.PIPE,50- stderr=subprocess.PIPE,49+ capture_output=True,50 encoding="utf-8",51 )52 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_testing/test_app01.py+1 added-2 removed
10 unmodified lines11 12 def test_script():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 )18 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_testing/test_app02_an.py+1 added-2 removed
10 unmodified lines11 12 def test_script():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 )18 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_testing/test_app02.py+1 added-2 removed
10 unmodified lines11 12 def test_script():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 )18 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_testing/test_app03.py+1 added-2 removed
10 unmodified lines11 12 def test_script():13 result = subprocess.run(14 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],15- stdout=subprocess.PIPE,16- stderr=subprocess.PIPE,15+ capture_output=True,16 encoding="utf-8",17 )18 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_using_click/test_tutorial003.py+1 added-2 removed
32 unmodified lines33 34 def test_script():35 result = subprocess.run(36 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],37- stdout=subprocess.PIPE,38- stderr=subprocess.PIPE,37+ capture_output=True,38 encoding="utf-8",39 )40 assert "Usage" in result.stdoutmodified:tests/test_tutorial/test_using_click/test_tutorial004.py+1 added-2 removed
31 unmodified lines32 33 def test_script():34 result = subprocess.run(35 [sys.executable, "-m", "coverage", "run", mod.__file__, "--help"],36- stdout=subprocess.PIPE,37- stderr=subprocess.PIPE,36+ capture_output=True,37 encoding="utf-8",38 )39 assert "Usage" in result.stdoutmodified:tests/test_ambiguous_params.py+27 added-21 removed
33 unmodified lines34 35 with pytest.raises(AnnotatedParamWithDefaultValueError) as excinfo:36 runner.invoke(app)37 38- assert vars(excinfo.value) == dict(39- param_type=typer.models.ArgumentInfo,40- argument_name="my_param",41- )38+ assert vars(excinfo.value) == {39+ "param_type": typer.models.ArgumentInfo,40+ "argument_name": "my_param",41+ }42 43 44 def test_allow_options_to_have_names():45 app = typer.Typer()23 unmodified lines69 70 with pytest.raises(MixedAnnotatedAndDefaultStyleError) as excinfo:71 runner.invoke(app)72 73- assert vars(excinfo.value) == dict(74- argument_name="my_param",75- annotated_param_type=param_info_type,76- default_param_type=param_info_type,77- )73+ assert vars(excinfo.value) == {74+ "argument_name": "my_param",75+ "annotated_param_type": param_info_type,76+ "default_param_type": param_info_type,77+ }78 79 80 def test_forbid_multiple_typer_params_in_annotated():81 app = typer.Typer()82 83 @app.command()84- def cmd(my_param: Annotated[str, typer.Argument(), typer.Argument()]):84+ def cmd(85+ my_param: Annotated[str, typer.Argument(), typer.Argument()],86+ ):87 ... # pragma: no cover88 89 with pytest.raises(MultipleTyperAnnotationsError) as excinfo:90 runner.invoke(app)91 90- assert vars(excinfo.value) == dict(argument_name="my_param")92+ assert vars(excinfo.value) == {"argument_name": "my_param"}93 94 95 def test_allow_multiple_non_typer_params_in_annotated():96 app = typer.Typer()21 unmodified lines118 119 app = typer.Typer()120 121 @app.command()120- def cmd(my_param: Annotated[str, param(default_factory=make_string)] = "hello"):122+ def cmd(123+ my_param: Annotated[str, param(default_factory=make_string)] = "hello",124+ ):125 ... # pragma: no cover126 127 with pytest.raises(DefaultFactoryAndDefaultValueError) as excinfo:128 runner.invoke(app)129 126- assert vars(excinfo.value) == dict(127- argument_name="my_param",128- param_type=param_info_type,129- )130+ assert vars(excinfo.value) == {131+ "argument_name": "my_param",132+ "param_type": param_info_type,133+ }134 135 136 @pytest.mark.parametrize(137 "param",30 unmodified lines168 169 app = typer.Typer()170 171 @app.command()168- def cmd(my_param: str = param("hi", default_factory=make_string)):172+ def cmd(173+ my_param: str = param("hi", default_factory=make_string),174+ ):175 ... # pragma: no cover176 177 with pytest.raises(DefaultFactoryAndDefaultValueError) as excinfo:178 runner.invoke(app)179 174- assert vars(excinfo.value) == dict(175- argument_name="my_param",176- param_type=param_info_type,177- )180+ assert vars(excinfo.value) == {181+ "argument_name": "my_param",182+ "param_type": param_info_type,183+ }184 185 186 @pytest.mark.parametrize(187 ["error", "message"],49 unmodified linesmodified:tests/test_others.py+5 added-9 removed
143 unmodified lines144 def test_completion_untyped_parameters():145 file_path = Path(__file__).parent / "assets/completion_no_types.py"146 result = subprocess.run(147 [sys.executable, "-m", "coverage", "run", str(file_path)],148- stdout=subprocess.PIPE,149- stderr=subprocess.PIPE,148+ capture_output=True,149 encoding="utf-8",150 env={151 **os.environ,152 "_COMPLETION_NO_TYPES.PY_COMPLETE": "complete_zsh",8 unmodified lines161 assert '"Carlos":"The writer of scripts."' in result.stdout162 163 result = subprocess.run(164 [sys.executable, "-m", "coverage", "run", str(file_path)],166- stdout=subprocess.PIPE,167- stderr=subprocess.PIPE,165+ capture_output=True,166 encoding="utf-8",167 )168 assert "Hello World" in result.stdout169 1 unmodified line171 def test_completion_untyped_parameters_different_order_correct_names():172 file_path = Path(__file__).parent / "assets/completion_no_types_order.py"173 result = subprocess.run(174 [sys.executable, "-m", "coverage", "run", str(file_path)],177- stdout=subprocess.PIPE,178- stderr=subprocess.PIPE,175+ capture_output=True,176 encoding="utf-8",177 env={178 **os.environ,179 "_COMPLETION_NO_TYPES_ORDER.PY_COMPLETE": "complete_zsh",8 unmodified lines188 assert '"Carlos":"The writer of scripts."' in result.stdout189 190 result = subprocess.run(191 [sys.executable, "-m", "coverage", "run", str(file_path)],195- stdout=subprocess.PIPE,196- stderr=subprocess.PIPE,192+ capture_output=True,193 encoding="utf-8",194 )195 assert "Hello World" in result.stdout196 34 unmodified lines231 )232 233 234 def test_context_settings_inheritance_single_command():239- app = typer.Typer(context_settings=dict(help_option_names=["-h", "--help"]))235+ app = typer.Typer(context_settings={"help_option_names": ["-h", "--help"]})236 237 @app.command()238 def main(name: str):239 pass # pragma: nocover21 unmodified linesmodified:tests/test_prog_name.py+1 added-2 removed
5 unmodified lines6 def test_custom_prog_name():7 file_path = Path(__file__).parent / "assets/prog_name.py"8 result = subprocess.run(9 [sys.executable, "-m", "coverage", "run", str(file_path), "--help"],10- stdout=subprocess.PIPE,11- stderr=subprocess.PIPE,10+ capture_output=True,11 encoding="utf-8",12 )13 assert "Usage: custom-name [OPTIONS] I" in result.stdoutmodified:tests/test_tracebacks.py+3 added-6 removed
6 unmodified lines7 def test_traceback_no_rich():8 file_path = Path(__file__).parent / "assets/type_error_no_rich.py"9 result = subprocess.run(10 [sys.executable, "-m", "coverage", "run", str(file_path)],11- stdout=subprocess.PIPE,12- stderr=subprocess.PIPE,11+ capture_output=True,12 encoding="utf-8",13 env={**os.environ, "_TYPER_STANDARD_TRACEBACK": ""},14 )15 assert "return get_command(self)(*args, **kwargs)" not in result.stderr6 unmodified lines22 def test_traceback_no_rich_short_disable():23 file_path = Path(__file__).parent / "assets/type_error_no_rich_short_disable.py"24 result = subprocess.run(25 [sys.executable, "-m", "coverage", "run", str(file_path)],27- stdout=subprocess.PIPE,28- stderr=subprocess.PIPE,26+ capture_output=True,27 encoding="utf-8",28 env={**os.environ, "_TYPER_STANDARD_TRACEBACK": ""},29 )30 assert "return get_command(self)(*args, **kwargs)" not in result.stderr6 unmodified lines37 def test_unmodified_traceback():38 file_path = Path(__file__).parent / "assets/type_error_normal_traceback.py"39 result = subprocess.run(40 [sys.executable, "-m", "coverage", "run", str(file_path)],43- stdout=subprocess.PIPE,44- stderr=subprocess.PIPE,41+ capture_output=True,42 encoding="utf-8",43 env={**os.environ, "_TYPER_STANDARD_TRACEBACK": ""},44 )45 assert "morty" in result.stdout, "the call to the first app should work normally"7 unmodified linesmodified:tests/test_type_conversion.py+2 added-2 removed
96 unmodified lines97 app = typer.Typer()98 99 @app.command()100 def custom_parser(101- hex_value: int = typer.Argument(None, parser=lambda x: int(x, 0))101+ hex_value: int = typer.Argument(None, parser=lambda x: int(x, 0)),102 ):103 assert hex_value == 0x56104 105 result = runner.invoke(app, ["0x56"])15 unmodified lines121 app = typer.Typer()122 123 @app.command()124 def custom_click_type(125- hex_value: int = typer.Argument(None, click_type=BaseNumberParamType())125+ hex_value: int = typer.Argument(None, click_type=BaseNumberParamType()),126 ):127 assert hex_value == 0x56128 129 result = runner.invoke(app, ["0x56"])1 unmodified linemodified:typer/_completion_shared.py+6 added-6 removed
85 unmodified lines86 click.echo(f"Shell {shell} not supported.", err=True)87 raise click.exceptions.Exit(1)88 return (89 script90- % dict(91- complete_func="_{}_completion".format(cf_name),92- prog_name=prog_name,93- autocomplete_var=complete_var,94- )90+ % {91+ "complete_func": f"_{cf_name}_completion",92+ "prog_name": prog_name,93+ "autocomplete_var": complete_var,94+ }95 ).strip()96 97 98 def install_bash(*, prog_name: str, complete_var: str, shell: str) -> Path:91 unmodified lines190 try:191 path_str = result.stdout.decode("utf8")192 except UnicodeDecodeError:193 click.echo("Couldn't decode the path automatically", err=True)194- raise click.exceptions.Exit(1)194+ raise195 path_obj = Path(path_str.strip())196 parent_dir: Path = path_obj.parent197 parent_dir.mkdir(parents=True, exist_ok=True)198 script_content = get_completion_script(42 unmodified linesmodified:typer/_typing.py+1 added-1 removed
250 unmodified lines251 # recreate types.UnionType (PEP604, Python >= 3.10)252 return _UnionGenericAlias(origin, converted)253 else:254 try:255- setattr(tp, "__args__", converted)255+ setattr(tp, "__args__", converted) # noqa: B010256 except AttributeError:257 pass258 return tp259 371 unmodified linesmodified:typer/core.py+3 added-3 removed
198 unmodified lines199 # chained commands which all returned `None` -- so it's not200 # even always obvious that `rv` indicates success/failure201 # by its truthiness/falsiness202 ctx.exit()203- except (EOFError, KeyboardInterrupt):203+ except (EOFError, KeyboardInterrupt) as e:204 click.echo(file=sys.stderr)205- raise click.Abort()205+ raise click.Abort() from e206 except click.ClickException as e:207 if not standalone_mode:208 raise209 # Typer override159 unmodified lines369 if self.metavar is not None:370 return self.metavar371 var = (self.name or "").upper()372 if not self.required:373- var = "[{}]".format(var)373+ var = f"[{var}]"374 type_var = self.type.get_metavar(self)375 if type_var:376 var += f":{type_var}"377 if self.nargs != 1:362 unmodified linesmodified:typer/main.py+17 added-14 removed
79 unmodified lines80 return81 tb_exc = traceback.TracebackException.from_exception(exc)82 stack: List[FrameSummary] = []83 for frame in tb_exc.stack:84- if any(85- [frame.filename.startswith(path) for path in supress_internal_dir_names]86- ):84+ if any(frame.filename.startswith(path) for path in supress_internal_dir_names):85 if not exception_config.pretty_exceptions_short:86 # Hide the line for internal libraries, Typer and Click87 stack.append(88 traceback.FrameSummary(278 unmodified lines367 if typer_instance._add_completion:368 click_command.params.append(click_install_param)369 click_command.params.append(click_show_param)370 return click_command373- assert False, "Could not get a command for this Typer instance" # pragma no cover371+ raise RuntimeError(372+ "Could not get a command for this Typer instance"373+ ) # pragma no cover374 375 376 def get_group_name(typer_info: TyperInfo) -> Optional[str]:377 if typer_info.callback:65 unmodified lines443 continue444 # Priority 2: Value was set in @subapp.callback()445 try:446 callback_value = getattr(447- typer_info.typer_instance.registered_callback, name # type: ignore447+ typer_info.typer_instance.registered_callback, # type: ignore448+ name,449 )450 if not isinstance(callback_value, DefaultPlaceholder):451 values[name] = callback_value452 continue1 unmodified line454 pass455 # Priority 3: Value set in subapp = typer.Typer()456 try:457 instance_value = getattr(457- typer_info.typer_instance.info, name # type: ignore458+ typer_info.typer_instance.info, # type: ignore459+ name,460 )461 if not isinstance(instance_value, DefaultPlaceholder):462 values[name] = instance_value463 continue76 unmodified lines540 return name.lower().replace("_", "-")541 542 543 def get_params_convertors_ctx_param_name_from_function(542- callback: Optional[Callable[..., Any]]544+ callback: Optional[Callable[..., Any]],545 ) -> Tuple[List[Union[click.Argument, click.Option]], Dict[str, Any], Optional[str]]:546 params = []547 convertors = {}548 context_param_name = None111 unmodified lines660 def get_callback(661 *,662 callback: Optional[Callable[..., Any]] = None,663 params: Sequence[click.Parameter] = [],662- convertors: Dict[str, Callable[[str], Any]] = {},664+ convertors: Optional[Dict[str, Callable[[str], Any]]] = None,665 context_param_name: Optional[str] = None,666 pretty_exceptions_short: bool,667 ) -> Optional[Callable[..., Any]]:668+ use_convertors = convertors or {}669 if not callback:670 return None671 parameters = get_params_from_function(callback)672 use_params: Dict[str, Any] = {}5 unmodified lines678 679 def wrapper(**kwargs: Any) -> Any:680 _rich_traceback_guard = pretty_exceptions_short # noqa: F841681 for k, v in kwargs.items():679- if k in convertors:680- use_params[k] = convertors[k](v)682+ if k in use_convertors:683+ use_params[k] = use_convertors[k](v)684 else:685 use_params[k] = v686 if context_param_name:687 use_params[context_param_name] = click.get_current_context()174 unmodified lines862 )863 if is_tuple:864 convertor = generate_tuple_convertor(main_type.__args__)865 if isinstance(parameter_info, OptionInfo):863- if main_type is bool and not (parameter_info.is_flag is False):866+ if main_type is bool and parameter_info.is_flag is not False:867 is_flag = True868 # Click doesn't accept a flag of type bool, only None, and then it sets it869 # to bool internally870 parameter_type = None77 unmodified lines948 rich_help_panel=parameter_info.rich_help_panel,949 ),950 convertor,951 )949- assert False, "A click.Parameter should be returned" # pragma no cover952+ raise AssertionError("A click.Parameter should be returned") # pragma no cover953 954 955 def get_param_callback(956 *,47 unmodified lines1004 return wrapper1005 1006 1007 def get_param_completion(1005- callback: Optional[Callable[..., Any]] = None1008+ callback: Optional[Callable[..., Any]] = None,1009 ) -> Optional[Callable[..., Any]]:1010 if not callback:1011 return None1012 parameters = get_params_from_function(callback)1013 ctx_name = None1014 args_name = None1015 incomplete_name = None1013- unassigned_params = [param for param in parameters.values()]1016+ unassigned_params = list(parameters.values())1017 for param_sig in unassigned_params[:]:1018 origin = getattr(param_sig.annotation, "__origin__", None)1019 if lenient_issubclass(param_sig.annotation, click.Context):1020 ctx_name = param_sig.name43 unmodified linesmodified:.pre-commit-config.yaml+5 added-35 removed
11 unmodified lines12 args:13 - --unsafe14 - id: end-of-file-fixer15 - id: trailing-whitespace16-- repo: https://github.com/asottile/pyupgrade17- rev: v3.15.016+- repo: https://github.com/astral-sh/ruff-pre-commit17+ rev: v0.2.018 hooks:19- - id: pyupgrade19+ - id: ruff20 args:21- - --py3-plus22- - --keep-runtime-typing23- # This file is more readable without yield from24- exclude: ^docs_src/progressbar/tutorial004\.py25-- repo: https://github.com/PyCQA/autoflake26- rev: v2.2.127- hooks:28- - id: autoflake29- args:30- - --recursive31- - --in-place32- - --remove-all-unused-imports33- - --remove-unused-variables34- - --expand-star-imports35- - --exclude36- - __init__.py37- - --remove-duplicate-keys38-- repo: https://github.com/pycqa/isort39- rev: 5.12.040- hooks:41- - id: isort42- name: isort (python)43- - id: isort44- name: isort (cython)45- types: [cython]46- - id: isort47- name: isort (pyi)48- types: [pyi]49-- repo: https://github.com/psf/black50- rev: 23.10.051- hooks:52- - id: black21+ - --fix22+ - id: ruff-format23 ci:24 autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks25 autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdatemodified:pyproject.toml+50 added
72 unmodified lines73 "ignore:'autocompletion' is renamed to 'shell_complete'. The old name is deprecated and will be removed in Click 8.1. See the docs about 'Parameter' for information about new behavior.:DeprecationWarning:typer",74 # For pytest-xdist75 'ignore::DeprecationWarning:xdist',76 ]77+78+[tool.ruff.lint]79+select = [80+ "E", # pycodestyle errors81+ "W", # pycodestyle warnings82+ "F", # pyflakes83+ "I", # isort84+ "B", # flake8-bugbear85+ "C4", # flake8-comprehensions86+ "UP", # pyupgrade87+]88+ignore = [89+ "E501", # line too long, handled by black90+ "B008", # do not perform function calls in argument defaults91+ "C901", # too complex92+ "W191", # indentation contains tabs93+]94+95+[tool.ruff.lint.per-file-ignores]96+# "__init__.py" = ["F401"]97+# This file is more readable without yield from98+"docs_src/progressbar/tutorial004.py" = ["UP028", "B007"]99+# Default mutable data structure100+"docs_src/options_autocompletion/tutorial006_an.py" = ["B006"]101+"docs_src/multiple_values/multiple_options/tutorial002_an.py" = ["B006"]102+"docs_src/options_autocompletion/tutorial007_an.py" = ["B006"]103+"docs_src/options_autocompletion/tutorial008_an.py" = ["B006"]104+"docs_src/options_autocompletion/tutorial009_an.py" = ["B006"]105+"docs_src/parameter_types/enum/tutorial003_an.py" = ["B006"]106+# Loop control variable `value` not used within loop body107+"docs_src/progressbar/tutorial001.py" = ["B007"]108+"docs_src/progressbar/tutorial003.py" = ["B007"]109+"docs_src/progressbar/tutorial005.py" = ["B007"]110+"docs_src/progressbar/tutorial006.py" = ["B007"]111+# Local variable `delete` is assigned to but never used112+"docs_src/prompt/tutorial003.py" = ["F841"]113+# Loop control variable `x` not used within loop body114+"docs_src/using_click/tutorial001.py" = ["B007"]115+116+# TODO: refactor _typing.py, remove unnecessary code117+"typer/_typing.py" = ["UP036", "F822"]118+119+[tool.ruff.lint.isort]120+known-third-party = ["typer", "click"]121+# For docs_src/subcommands/tutorial003/122+known-first-party = ["reigns", "towns", "lands", "items", "users"]123+124+[tool.ruff.lint.pyupgrade]125+# Preserve types, even if a file imports `from __future__ import annotations`.126+keep-runtime-typing = truemodified:requirements-tests.txt+1 added-2 removed
4 unmodified lines5 coverage[toml] >=6.2,<7.06 pytest-xdist >=1.32.0,<4.0.07 pytest-sugar >=0.9.4,<0.10.08 mypy ==0.9719-black >=22.3.0,<23.0.010-isort >=5.0.6,<6.0.09+ruff ==0.2.0