From a1a807baee8f84eefc2b02ef1a34e2947528a5e9 Mon Sep 17 00:00:00 2001 From: thecr8tr Date: Sat, 1 Jan 2022 13:00:50 -0500 Subject: [PATCH 1/3] PEP484 hints for py/selenium/webdriver/chrome/options.py --- py/selenium/webdriver/chrome/options.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/py/selenium/webdriver/chrome/options.py b/py/selenium/webdriver/chrome/options.py index 5fe1cb8b4ce4c..80ef3064c6e84 100644 --- a/py/selenium/webdriver/chrome/options.py +++ b/py/selenium/webdriver/chrome/options.py @@ -17,6 +17,7 @@ from selenium.webdriver.chromium.options import ChromiumOptions from selenium.webdriver.common.desired_capabilities import DesiredCapabilities +from typing import Optional class Options(ChromiumOptions): @@ -25,5 +26,9 @@ class Options(ChromiumOptions): def default_capabilities(self) -> dict: return DesiredCapabilities.CHROME.copy() - def enable_mobile(self, android_package="com.android.chrome", android_activity=None, device_serial=None): + def enable_mobile(self, + android_package: str = "com.android.chrome", + android_activity: Optional[str] = None, + device_serial: Optional[str] = None + ) -> None: super().enable_mobile(android_package, android_activity, device_serial) From be4200b2e73db3fadcc842e1f3fb5d9b1accb84b Mon Sep 17 00:00:00 2001 From: thecr8tr Date: Sat, 1 Jan 2022 13:16:19 -0500 Subject: [PATCH 2/3] PEP484 hints for py/selenium/webdriver/chrome/options.py --- py/selenium/webdriver/chrome/options.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/selenium/webdriver/chrome/options.py b/py/selenium/webdriver/chrome/options.py index 80ef3064c6e84..d3ce2426eee38 100644 --- a/py/selenium/webdriver/chrome/options.py +++ b/py/selenium/webdriver/chrome/options.py @@ -17,7 +17,7 @@ from selenium.webdriver.chromium.options import ChromiumOptions from selenium.webdriver.common.desired_capabilities import DesiredCapabilities -from typing import Optional +from typing import Optional, NoReturn class Options(ChromiumOptions): @@ -30,5 +30,5 @@ def enable_mobile(self, android_package: str = "com.android.chrome", android_activity: Optional[str] = None, device_serial: Optional[str] = None - ) -> None: + ) -> NoReturn: super().enable_mobile(android_package, android_activity, device_serial) From 411b82ddaf2e2d79dd65f34d90ebb18d5f78865d Mon Sep 17 00:00:00 2001 From: thecr8tr Date: Tue, 4 Jan 2022 16:49:30 -0500 Subject: [PATCH 3/3] PEP484 hints for py/selenium/webdriver/chrome/webdriver.py Correcting NoReturn to None --- py/selenium/webdriver/chrome/options.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/selenium/webdriver/chrome/options.py b/py/selenium/webdriver/chrome/options.py index d3ce2426eee38..80ef3064c6e84 100644 --- a/py/selenium/webdriver/chrome/options.py +++ b/py/selenium/webdriver/chrome/options.py @@ -17,7 +17,7 @@ from selenium.webdriver.chromium.options import ChromiumOptions from selenium.webdriver.common.desired_capabilities import DesiredCapabilities -from typing import Optional, NoReturn +from typing import Optional class Options(ChromiumOptions): @@ -30,5 +30,5 @@ def enable_mobile(self, android_package: str = "com.android.chrome", android_activity: Optional[str] = None, device_serial: Optional[str] = None - ) -> NoReturn: + ) -> None: super().enable_mobile(android_package, android_activity, device_serial)