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
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -14,20 +14,20 @@ repos:
- id: check-executables-have-shebangs
- id: check-merge-conflict
- repo: https://github.com/psf/black
rev: 21.9b0
rev: 21.12b0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910-1
rev: v0.931
hooks:
- id: mypy
additional_dependencies: [types-pyOpenSSL==20.0.6]
additional_dependencies: [types-pyOpenSSL==21.0.3]
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.9.3
rev: 5.10.1
hooks:
- id: isort
- repo: local
Expand All @@ -38,4 +38,4 @@ repos:
language: node
pass_filenames: false
types: [python]
additional_dependencies: ["pyright@1.1.181"]
additional_dependencies: ["pyright@1.1.210"]
34 changes: 17 additions & 17 deletions local-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
auditwheel==5.0.0
autobahn==21.3.1
black==21.9b0
flake8==3.9.2
auditwheel==5.1.2
autobahn==21.11.1
black==21.12b0
flake8==4.0.1
flaky==3.7.0
mypy==0.910
mypy==0.931
objgraph==3.5.0
Pillow==9.0.0
pixelmatch==0.2.3
pre-commit==2.15.0
pyOpenSSL==20.0.1
pixelmatch==0.2.4
pre-commit==2.16.0
pyOpenSSL==21.0.0
pytest==6.2.5
pytest-asyncio==0.15.1
pytest-cov==2.12.1
pytest-asyncio==0.17.1
pytest-cov==3.0.0
pytest-repeat==0.9.1
pytest-sugar==0.9.4
pytest-timeout==1.4.2
pytest-xdist==2.4.0
requests==2.26.0
pytest-timeout==2.0.2
pytest-xdist==2.5.0
requests==2.27.1
service_identity==21.1.0
setuptools==58.1.0
twine==3.4.2
setuptools==60.5.0
twine==3.7.1
twisted==21.7.0
types-pyOpenSSL==20.0.6
wheel==0.37.0
types-pyOpenSSL==21.0.3
wheel==0.37.1
9 changes: 3 additions & 6 deletions playwright/_impl/_impl_to_api_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
# limitations under the License.

import inspect
from types import MethodType
from typing import Any, Callable, Dict, List, Optional, cast
from typing import Any, Callable, Dict, List, Optional

from playwright._impl._api_types import Error

Expand Down Expand Up @@ -91,13 +90,11 @@ def wrapper_func(*args: Any) -> Any:
)

if inspect.ismethod(handler):
wrapper = getattr(
cast(MethodType, handler).__self__, IMPL_ATTR + handler.__name__, None
)
wrapper = getattr(handler.__self__, IMPL_ATTR + handler.__name__, None)
if not wrapper:
wrapper = wrapper_func
setattr(
cast(MethodType, handler).__self__,
handler.__self__,
IMPL_ATTR + handler.__name__,
wrapper,
)
Expand Down
2 changes: 1 addition & 1 deletion playwright/_impl/_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def expect_event(
timeout = cast(Any, self._parent)._timeout_settings.timeout()
wait_helper = WaitHelper(self, f"web_socket.expect_event({event})")
wait_helper.reject_on_timeout(
timeout, f'Timeout while waiting for event "{event}"'
cast(float, timeout), f'Timeout while waiting for event "{event}"'
)
if event != WebSocket.Events.Close:
wait_helper.reject_on_event(
Expand Down
3 changes: 3 additions & 0 deletions tests/sync/test_accessibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Any, Dict

import pytest

from playwright.sync_api import Page
Expand Down Expand Up @@ -220,6 +222,7 @@ def test_accessibility_filtering_children_of_leaf_nodes_rich_text_editable_field
Edit this image: <img src="fakeimage.png" alt="my fake image">
</div>"""
)
golden: Dict[str, Any]
if is_firefox:
golden = {
"role": "textbox",
Expand Down