Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions py/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,10 @@ warn_unused_ignores = true
# warns when returning a value with typing.Any from a function with a non typing.Any return type.
warn_return_any = false
# Shows a warning when encountering any code inferred to be unreachable after performing type analysis.
warn_unreachable = false
warn_unreachable = true

[[tool.mypy.overrides]]
module = [
"selenium.webdriver.common.devtools.*",
"selenium.webdriver.common.bidi.*",
]
ignore_errors = true
Expand Down
2 changes: 1 addition & 1 deletion py/selenium/webdriver/common/_bidi/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def as_json(self) -> dict:
return payload

@classmethod
def from_json(cls, payload: dict) -> Any:
def from_json(cls, payload: Any) -> Any:
if not isinstance(payload, dict):
got = type(payload).__name__
raise BiDiSerializationError(f"{cls.__name__} expected an object on the wire, got {got} {payload!r}")
Expand Down
2 changes: 1 addition & 1 deletion py/selenium/webdriver/common/actions/pointer_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def create_pointer_move(
duration=DEFAULT_MOVE_DURATION,
x: float = 0,
y: float = 0,
origin: WebElement | None = None,
origin: WebElement | str | None = None,
**kwargs,
):
action = {"type": "pointerMove", "duration": duration, "x": x, "y": y, **kwargs}
Expand Down
20 changes: 10 additions & 10 deletions py/selenium/webdriver/common/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,16 @@ def __set__(self, obj, value):
class Proxy:
"""Proxy configuration containing proxy type and necessary proxy settings."""

proxyType = ProxyType.UNSPECIFIED
autodetect = False
httpProxy = ""
noProxy = ""
proxyAutoconfigUrl = ""
sslProxy = ""
socksProxy = ""
socksUsername = ""
socksPassword = ""
socksVersion = None
proxyType: dict = ProxyType.UNSPECIFIED
autodetect: bool = False
httpProxy: str = ""
noProxy: str | list[str] = ""
proxyAutoconfigUrl: str = ""
sslProxy: str = ""
socksProxy: str = ""
socksUsername: str = ""
socksPassword: str = ""
socksVersion: int | None = None

# create descriptor type objects
auto_detect = _ProxyTypeDescriptor("autodetect", ProxyType.AUTODETECT)
Expand Down
7 changes: 3 additions & 4 deletions py/selenium/webdriver/common/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import sys
from abc import ABC, abstractmethod
from collections.abc import Mapping
from io import IOBase
from subprocess import PIPE
from time import sleep
from typing import IO, Any
Expand Down Expand Up @@ -156,10 +155,10 @@ def send_remote_shutdown_command(self) -> None:
def stop(self) -> None:
"""Stops the service."""
if self.log_output not in {PIPE, subprocess.DEVNULL}:
if isinstance(self.log_output, IOBase) and self._owns_log_output:
self.log_output.close()
elif isinstance(self.log_output, int):
if isinstance(self.log_output, int):
os.close(self.log_output)
elif self.log_output is not None and self._owns_log_output:
self.log_output.close()
if self.process is not None:
try:
if self.process.poll() is None:
Expand Down
2 changes: 1 addition & 1 deletion py/selenium/webdriver/firefox/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

class Log:
def __init__(self) -> None:
self.level = None
self.level: str | None = None

def to_capabilities(self) -> dict:
if self.level:
Expand Down