Skip to content

Commit db50715

Browse files
committed
[py] fix black and flake8 linting issues
1 parent c258b22 commit db50715

File tree

6 files changed

+5
-20
lines changed

6 files changed

+5
-20
lines changed

py/conftest.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ def fin():
137137
if driver_class == "Chrome":
138138
options = get_options(driver_class, request.config)
139139
if driver_class == "Remote":
140-
options = (
141-
get_options("Firefox", request.config) or webdriver.FirefoxOptions()
142-
)
140+
options = get_options("Firefox", request.config) or webdriver.FirefoxOptions()
143141
options.set_capability("moz:firefoxOptions", {})
144142
options.enable_downloads = True
145143
if driver_class == "WebKitGTK":
@@ -282,9 +280,7 @@ def wait_for_server(url, timeout):
282280
]
283281
)
284282
print(f"Selenium server running as process: {process.pid}")
285-
assert wait_for_server(
286-
url, 10
287-
), f"Timed out waiting for Selenium server at {url}"
283+
assert wait_for_server(url, 10), f"Timed out waiting for Selenium server at {url}"
288284
print("Selenium server is ready")
289285
yield process
290286
process.terminate()

py/selenium/webdriver/common/driver_finder.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ def get_path(service: Service, options: BaseOptions) -> str:
4141
raise NoSuchDriverException(msg) from err
4242

4343
if path is None or not Path(path).is_file():
44-
raise NoSuchDriverException(
45-
f"Unable to locate or obtain driver for {options.capabilities['browserName']}"
46-
)
44+
raise NoSuchDriverException(f"Unable to locate or obtain driver for {options.capabilities['browserName']}")
4745

4846
return path

py/selenium/webdriver/common/service.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ def assert_process_still_running(self) -> None:
112112
"""Check if the underlying process is still running."""
113113
return_code = self.process.poll()
114114
if return_code:
115-
raise WebDriverException(
116-
f"Service {self._path} unexpectedly exited. Status code was: {return_code}"
117-
)
115+
raise WebDriverException(f"Service {self._path} unexpectedly exited. Status code was: {return_code}")
118116

119117
def is_connectable(self) -> bool:
120118
"""Establishes a socket connection to determine if the service running
@@ -204,9 +202,7 @@ def _start_process(self, path: str) -> None:
204202
start_info = None
205203
if system() == "Windows":
206204
start_info = subprocess.STARTUPINFO()
207-
start_info.dwFlags = (
208-
subprocess.CREATE_NEW_CONSOLE | subprocess.STARTF_USESHOWWINDOW
209-
)
205+
start_info.dwFlags = subprocess.CREATE_NEW_CONSOLE | subprocess.STARTF_USESHOWWINDOW
210206
start_info.wShowWindow = subprocess.SW_HIDE
211207

212208
self.process = subprocess.Popen(

py/test/selenium/webdriver/chrome/chrome_launcher_tests.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
import pytest
1919

20-
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
21-
2220

2321
@pytest.mark.no_driver_after_test
2422
def test_launch_and_close_browser(clean_driver, clean_service):

py/test/selenium/webdriver/chrome/chrome_service_tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import pytest
2222

2323
from selenium.common.exceptions import WebDriverException
24-
from selenium.webdriver import Chrome
2524
from selenium.webdriver.chrome.service import Service
2625

2726

py/test/selenium/webdriver/common/selenium_manager_tests.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
from selenium.common.exceptions import WebDriverException
2323
from selenium.webdriver.chrome.options import Options
24-
from selenium.webdriver.chrome.service import Service
25-
from selenium.webdriver.common.driver_finder import DriverFinder
2624
from selenium.webdriver.common.proxy import Proxy
2725
from selenium.webdriver.common.selenium_manager import SeleniumManager
2826

0 commit comments

Comments
 (0)