File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 1818web automation that is ever-green, capable, reliable and fast.
1919"""
2020
21- from typing import Optional , Union , overload
21+ from typing import Any , Optional , Union , overload
2222
2323import playwright ._impl ._api_structures
2424import playwright ._impl ._api_types
@@ -88,10 +88,12 @@ def async_playwright() -> PlaywrightContextManager:
8888
8989
9090class Expect :
91+ _unset : Any = object ()
92+
9193 def __init__ (self ) -> None :
9294 self ._timeout : Optional [float ] = None
9395
94- def set_options (self , timeout : float = None ) -> None :
96+ def set_options (self , timeout : Optional [ float ] = _unset ) -> None :
9597 """
9698 This method sets global `expect()` options.
9799
@@ -101,7 +103,7 @@ def set_options(self, timeout: float = None) -> None:
101103 Returns:
102104 None
103105 """
104- if timeout is not None :
106+ if timeout is not self . _unset :
105107 self ._timeout = timeout
106108
107109 @overload
Original file line number Diff line number Diff line change 1818web automation that is ever-green, capable, reliable and fast.
1919"""
2020
21- from typing import Optional , Union , overload
21+ from typing import Any , Optional , Union , overload
2222
2323import playwright ._impl ._api_structures
2424import playwright ._impl ._api_types
@@ -88,10 +88,12 @@ def sync_playwright() -> PlaywrightContextManager:
8888
8989
9090class Expect :
91+ _unset : Any = object ()
92+
9193 def __init__ (self ) -> None :
9294 self ._timeout : Optional [float ] = None
9395
94- def set_options (self , timeout : float = None ) -> None :
96+ def set_options (self , timeout : Optional [ float ] = _unset ) -> None :
9597 """
9698 This method sets global `expect()` options.
9799
@@ -101,7 +103,7 @@ def set_options(self, timeout: float = None) -> None:
101103 Returns:
102104 None
103105 """
104- if timeout is not None :
106+ if timeout is not self . _unset :
105107 self ._timeout = timeout
106108
107109 @overload
You can’t perform that action at this time.
0 commit comments