diff --git a/tests/test_launch.py b/tests/test_launch.py index 75aaa2f091..eeb11f0e05 100644 --- a/tests/test_launch.py +++ b/tests/test_launch.py @@ -48,4 +48,11 @@ def test_calls_original_launch_when_not_passing_urls(): with patch("typer.main.click.launch", return_value=0) as launch_mock: typer.launch("not a url") - launch_mock.assert_called_once_with("not a url") + launch_mock.assert_called_once_with("not a url", wait=False, locate=False) + + +def test_launch_locating_file(): + with patch("typer.main.click.launch", return_value=0) as launch_mock: + typer.launch("/path/to/file", locate=True) + + launch_mock.assert_called_once_with("/path/to/file", wait=False, locate=True) diff --git a/typer/main.py b/typer/main.py index 508d96617e..1987df3dad 100644 --- a/typer/main.py +++ b/typer/main.py @@ -1136,4 +1136,4 @@ def launch(url: str, wait: bool = False, locate: bool = False) -> int: return 0 else: - return click.launch(url) + return click.launch(url, wait=wait, locate=locate)