🚚 Rename test to corner-cases to make it more explicit (#1083)
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 0b89650 · Browse files · 5 files·+54 added−54 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+54 added−54 removed
- tests:+54 added−54 removed
Provenance
- Commit
6eba265- Tree
44fd1e1- Author
Sebastián Ramírez <tiangolo@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
0b89650
5 files changed+54 added−54 removed
deleted:tests/assets/compat_click7_8.py-19 removed
1-import typer2-3-app = typer.Typer()4-5-6-@app.command(context_settings={"auto_envvar_prefix": "TEST"})7-def main(8- name: str = typer.Option("John", hidden=True),9- lastname: str = typer.Option("Doe", "/lastname", show_default="Mr. Doe"),10- age: int = typer.Option(lambda: 42, show_default=True),11-):12- """13- Say hello.14- """15- print(f"Hello {name} {lastname}, it seems you have {age}")16-17-18-if __name__ == "__main__":19- app()added:tests/assets/conrner_cases.py+19 added
1+import typer2+3+app = typer.Typer()4+5+6+@app.command(context_settings={"auto_envvar_prefix": "TEST"})7+def main(8+ name: str = typer.Option("John", hidden=True),9+ lastname: str = typer.Option("Doe", "/lastname", show_default="Mr. Doe"),10+ age: int = typer.Option(lambda: 42, show_default=True),11+):12+ """13+ Say hello.14+ """15+ print(f"Hello {name} {lastname}, it seems you have {age}")16+17+18+if __name__ == "__main__":19+ app()deleted:tests/test_compat/__init__.py
deleted:tests/test_compat/test_option_get_help.py-35 removed
1-import typer.core2-from typer.testing import CliRunner3-4-from tests.assets import compat_click7_8 as mod5-6-runner = CliRunner()7-8-9-def test_hidden_option():10- result = runner.invoke(mod.app, ["--help"])11- assert result.exit_code == 012- assert "Say hello" in result.output13- assert "--name" not in result.output14- assert "/lastname" in result.output15- assert "TEST_LASTNAME" in result.output16- assert "(dynamic)" in result.output17-18-19-def test_hidden_option_no_rich():20- rich = typer.core.rich21- typer.core.rich = None22- result = runner.invoke(mod.app, ["--help"])23- assert result.exit_code == 024- assert "Say hello" in result.output25- assert "--name" not in result.output26- assert "/lastname" in result.output27- assert "TEST_LASTNAME" in result.output28- assert "(dynamic)" in result.output29- typer.core.rich = rich30-31-32-def test_coverage_call():33- result = runner.invoke(mod.app)34- assert result.exit_code == 035- assert "Hello John Doe, it seems you have 42" in result.outputadded:tests/test_corner_cases.py+35 added
1+import typer.core2+from typer.testing import CliRunner3+4+from tests.assets import conrner_cases as mod5+6+runner = CliRunner()7+8+9+def test_hidden_option():10+ result = runner.invoke(mod.app, ["--help"])11+ assert result.exit_code == 012+ assert "Say hello" in result.output13+ assert "--name" not in result.output14+ assert "/lastname" in result.output15+ assert "TEST_LASTNAME" in result.output16+ assert "(dynamic)" in result.output17+18+19+def test_hidden_option_no_rich():20+ rich = typer.core.rich21+ typer.core.rich = None22+ result = runner.invoke(mod.app, ["--help"])23+ assert result.exit_code == 024+ assert "Say hello" in result.output25+ assert "--name" not in result.output26+ assert "/lastname" in result.output27+ assert "TEST_LASTNAME" in result.output28+ assert "(dynamic)" in result.output29+ typer.core.rich = rich30+31+32+def test_coverage_call():33+ result = runner.invoke(mod.app)34+ assert result.exit_code == 035+ assert "Hello John Doe, it seems you have 42" in result.output