Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct the launch_browser fixture behaviour when --browser-channel f… #78

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions pytest_playwright/pytest_playwright.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ def launch_browser(
browser_type_launch_args: Dict,
browser_type: BrowserType,
) -> Callable[..., Browser]:
if (
browser_type.name != "chromium"
and browser_type_launch_args.get("channel") == "chrome"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and browser_type_launch_args.get("channel") == "chrome"

):
del browser_type_launch_args["channel"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
del browser_type_launch_args["channel"]
browser_type_launch_args.pop("channel",None)


def launch(**kwargs: Dict) -> Browser:
launch_options = {**browser_type_launch_args, **kwargs}
browser = browser_type.launch(**launch_options)
Expand Down