Skip to content

Commit

Permalink
added a test
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Mar 17, 2021
1 parent c9287f8 commit 07d19cf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion playwright/_impl/_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def is_safe_close_error(error: Exception) -> bool:


def not_installed_error(message: str) -> Exception:
return Exception(
return Error(
f"""
================================================================================
{message}
Expand Down
9 changes: 9 additions & 0 deletions tests/async/test_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,12 @@ async def test_browser_close_should_be_callable_twice(browser_type, launch_argum
browser.close(),
)
await browser.close()


async def test_browser_launch_non_existing_executable_path_shows_install_msg(
browser_type,
tmpdir,
):
with pytest.raises(Error) as exc_info:
await browser_type.launch(executable_path=tmpdir.join("executable"))
assert "python -m playwright install" in exc_info.value.message

0 comments on commit 07d19cf

Please sign in to comment.