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* 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 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(