Skip to content

Commit 9c79ce3

Browse files
committed
ran scripts/format.sh
1 parent 48abb18 commit 9c79ce3

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

py/selenium/common/__init__.py

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

18+
from .exceptions import DetachedShadowRootException
1819
from .exceptions import ElementClickInterceptedException
1920
from .exceptions import ElementNotInteractableException
2021
from .exceptions import ElementNotSelectableException
@@ -48,7 +49,6 @@
4849
from .exceptions import UnexpectedTagNameException
4950
from .exceptions import UnknownMethodException
5051
from .exceptions import WebDriverException
51-
from .exceptions import DetachedShadowRootException
5252

5353
__all__ = [
5454
"WebDriverException",
@@ -84,5 +84,5 @@
8484
"InvalidSessionIdException",
8585
"SessionNotCreatedException",
8686
"UnknownMethodException",
87-
"DetachedShadowRootException"
87+
"DetachedShadowRootException",
8888
]

py/selenium/common/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,6 @@ def __init__(
286286

287287
super().__init__(with_support, screen, stacktrace)
288288

289+
289290
class DetachedShadowRootException(WebDriverException):
290291
"""Raised when referenced shadow root is no longer attached to the DOM"""
291-

py/selenium/webdriver/remote/errorhandler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
from typing import Dict
2020
from typing import Type
2121

22+
from selenium.common.exceptions import DetachedShadowRootException
2223
from selenium.common.exceptions import ElementClickInterceptedException
2324
from selenium.common.exceptions import ElementNotInteractableException
2425
from selenium.common.exceptions import ElementNotSelectableException
2526
from selenium.common.exceptions import ElementNotVisibleException
26-
from selenium.common.exceptions import DetachedShadowRootException
2727
from selenium.common.exceptions import ImeActivationFailedException
2828
from selenium.common.exceptions import ImeNotAvailableException
2929
from selenium.common.exceptions import InsecureCertificateException
@@ -133,7 +133,7 @@ class ErrorCode:
133133
UNABLE_TO_CAPTURE_SCREEN = [63, "unable to capture screen"]
134134
ELEMENT_CLICK_INTERCEPTED = [64, "element click intercepted"]
135135
UNKNOWN_METHOD = ["unknown method exception"]
136-
DETACHED_SHADOW_ROOT = [65,"detached shadow root"]
136+
DETACHED_SHADOW_ROOT = [65, "detached shadow root"]
137137

138138
METHOD_NOT_ALLOWED = [405, "unsupported operation"]
139139

py/test/unit/selenium/webdriver/remote/error_handler_tests.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,14 @@ def test_raises_exception_for_unknown_method(handler, code):
240240
def test_raises_exception_for_method_not_allowed(handler, code):
241241
with pytest.raises(exceptions.WebDriverException):
242242
handler.check_response({"status": code, "value": "foo"})
243-
243+
244+
244245
@pytest.mark.parametrize("code", ErrorCode.DETACHED_SHADOW_ROOT)
245246
def test_raises_exception_for_invalid_selector(handler, code):
246247
with pytest.raises(exceptions.DetachedShadowRootException):
247248
handler.check_response({"status": code, "value": "foo"})
248249

250+
249251
@pytest.mark.parametrize("key", ["stackTrace", "stacktrace"])
250252
def test_relays_exception_stacktrace(handler, key):
251253
import json

0 commit comments

Comments
 (0)