From 5e7a62f0f2dff107596647f862d4c4d19a17d6ef Mon Sep 17 00:00:00 2001 From: danphenderson Date: Mon, 12 Feb 2024 15:40:37 -0800 Subject: [PATCH 1/3] chore: ingnore artificats when using pipenv for development --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 919e041a6..ce5522f8a 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ coverage.xml junit/ htmldocs/ utils/docker/dist/ +.venv/ +Pipfile* From e42b30a1d2952fc9592553e4f72b0bcf9cfbe8f8 Mon Sep 17 00:00:00 2001 From: danphenderson Date: Mon, 12 Feb 2024 17:35:45 -0800 Subject: [PATCH 2/3] feat: make TimeOutError be an instance of builtins.TimeOutError --- playwright/_impl/_errors.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playwright/_impl/_errors.py b/playwright/_impl/_errors.py index 9bd6ab901..e052d25bf 100644 --- a/playwright/_impl/_errors.py +++ b/playwright/_impl/_errors.py @@ -16,6 +16,7 @@ # stable API. +from builtins import TimeoutError as TimeoutErrorBuiltin from typing import Optional @@ -43,7 +44,7 @@ def stack(self) -> Optional[str]: return self._stack -class TimeoutError(Error): +class TimeoutError(Error, TimeoutErrorBuiltin): pass From 56993d20b133fa7ec4a590be1c05faeb4dac7c29 Mon Sep 17 00:00:00 2001 From: danphenderson Date: Tue, 13 Feb 2024 18:08:16 -0800 Subject: [PATCH 3/3] chore : adding coverage to TimeoutError tests --- tests/async/test_click.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/async/test_click.py b/tests/async/test_click.py index 8143a6b3d..98d0a49c1 100644 --- a/tests/async/test_click.py +++ b/tests/async/test_click.py @@ -13,6 +13,7 @@ # limitations under the License. import asyncio +import builtins from typing import Optional import pytest @@ -638,6 +639,9 @@ async def test_timeout_waiting_for_hit_target(page: Page, server: Server) -> Non assert "Timeout 5000ms exceeded." in error.message assert '
intercepts pointer events' in error.message assert "retrying click action" in error.message + assert isinstance(error, Error) + assert isinstance(error, TimeoutError) + assert isinstance(error, builtins.TimeoutError) async def test_fail_when_obscured_and_not_waiting_for_hit_target(