Skip to content

Commit 3167e93

Browse files
authored
[py]: new tox recipe for isort in non diff only mode (#11005)
* [py]: Automatically format `test/` with new `isort` recipe * [py]: use single line imports with isort * [py]: apply `isort` to all python files in `selenium/` & `test/`
1 parent 316f973 commit 3167e93

File tree

99 files changed

+308
-253
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+308
-253
lines changed

py/selenium/common/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
from .exceptions import UnknownMethodException
5050
from .exceptions import WebDriverException
5151

52-
5352
__all__ = ["WebDriverException",
5453
"InvalidSwitchToTargetException",
5554
"NoSuchFrameException",

py/selenium/common/exceptions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
Exceptions that may happen in all the webdriver code.
2020
"""
2121

22-
from typing import Optional, Sequence
22+
from typing import Optional
23+
from typing import Sequence
2324

2425

2526
class WebDriverException(Exception):

py/selenium/types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@
1919

2020
import typing
2121

22-
2322
AnyKey = typing.Union[str, int, float]
2423
WaitExcTypes = typing.Iterable[typing.Type[Exception]]

py/selenium/webdriver/__init__.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,26 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
from .firefox.webdriver import WebDriver as Firefox # noqa
18+
from .chrome.options import Options as ChromeOptions # noqa
19+
from .chrome.webdriver import WebDriver as Chrome # noqa
20+
from .common.action_chains import ActionChains # noqa
21+
from .common.desired_capabilities import DesiredCapabilities # noqa
22+
from .common.keys import Keys # noqa
23+
from .common.proxy import Proxy # noqa
24+
from .edge.options import Options as EdgeOptions # noqa
25+
from .edge.webdriver import WebDriver as ChromiumEdge # noqa
26+
from .edge.webdriver import WebDriver as Edge # noqa
1927
from .firefox.firefox_profile import FirefoxProfile # noqa
2028
from .firefox.options import Options as FirefoxOptions # noqa
21-
from .chrome.webdriver import WebDriver as Chrome # noqa
22-
from .chrome.options import Options as ChromeOptions # noqa
23-
from .ie.webdriver import WebDriver as Ie # noqa
29+
from .firefox.webdriver import WebDriver as Firefox # noqa
2430
from .ie.options import Options as IeOptions # noqa
25-
from .edge.webdriver import WebDriver as Edge # noqa
26-
from .edge.webdriver import WebDriver as ChromiumEdge # noqa
27-
from .edge.options import Options as EdgeOptions # noqa
31+
from .ie.webdriver import WebDriver as Ie # noqa
32+
from .remote.webdriver import WebDriver as Remote # noqa
2833
from .safari.webdriver import WebDriver as Safari # noqa
29-
from .webkitgtk.webdriver import WebDriver as WebKitGTK # noqa
3034
from .webkitgtk.options import Options as WebKitGTKOptions # noqa
31-
from .wpewebkit.webdriver import WebDriver as WPEWebKit # noqa
35+
from .webkitgtk.webdriver import WebDriver as WebKitGTK # noqa
3236
from .wpewebkit.options import Options as WPEWebKitOptions # noqa
33-
from .remote.webdriver import WebDriver as Remote # noqa
34-
from .common.desired_capabilities import DesiredCapabilities # noqa
35-
from .common.action_chains import ActionChains # noqa
36-
from .common.proxy import Proxy # noqa
37-
from .common.keys import Keys # noqa
37+
from .wpewebkit.webdriver import WebDriver as WPEWebKit # noqa
3838

3939
__version__ = '4.5.0'
4040

py/selenium/webdriver/chrome/options.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
from typing import Optional
19+
1820
from selenium.webdriver.chromium.options import ChromiumOptions
1921
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
20-
from typing import Optional
2122

2223

2324
class Options(ChromiumOptions):

py/selenium/webdriver/chrome/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
# under the License.
1717

1818
from typing import List
19-
from selenium.webdriver.chromium import service
2019

20+
from selenium.webdriver.chromium import service
2121

2222
DEFAULT_EXECUTABLE_PATH = "chromedriver"
2323

py/selenium/webdriver/chrome/webdriver.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
import warnings
18+
1819
from selenium.webdriver.chromium.webdriver import ChromiumDriver
19-
from .options import Options
20-
from .service import DEFAULT_EXECUTABLE_PATH, Service
2120
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
2221

22+
from .options import Options
23+
from .service import DEFAULT_EXECUTABLE_PATH
24+
from .service import Service
25+
2326
DEFAULT_PORT = 0
2427
DEFAULT_SERVICE_LOG_PATH = None
2528
DEFAULT_KEEP_ALIVE = None

py/selenium/webdriver/chromium/options.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
import base64
1919
import os
2020
import warnings
21-
from typing import List, Union, BinaryIO
21+
from typing import BinaryIO
22+
from typing import List
23+
from typing import Union
2224

2325
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
2426
from selenium.webdriver.common.options import ArgOptions

py/selenium/webdriver/chromium/service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# under the License.
1717

1818
from typing import List
19+
1920
from selenium.webdriver.common import service
2021

2122

py/selenium/webdriver/chromium/webdriver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
from selenium.webdriver.common.options import BaseOptions
19-
from selenium.webdriver.common.service import Service
20-
from selenium.webdriver.edge.options import Options as EdgeOptions
21-
from selenium.webdriver.chrome.options import Options as ChromeOptions
2218
import warnings
2319

20+
from selenium.webdriver.chrome.options import Options as ChromeOptions
2421
from selenium.webdriver.chromium.remote_connection import ChromiumRemoteConnection
22+
from selenium.webdriver.common.options import BaseOptions
23+
from selenium.webdriver.common.service import Service
24+
from selenium.webdriver.edge.options import Options as EdgeOptions
2525
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
2626

2727
DEFAULT_PORT = 0

0 commit comments

Comments
 (0)