File tree 2 files changed +10
-6
lines changed
2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 18
18
web automation that is ever-green, capable, reliable and fast.
19
19
"""
20
20
21
- from typing import Optional , Union , overload
21
+ from typing import Any , Optional , Union , overload
22
22
23
23
import playwright ._impl ._api_structures
24
24
import playwright ._impl ._api_types
@@ -88,10 +88,12 @@ def async_playwright() -> PlaywrightContextManager:
88
88
89
89
90
90
class Expect :
91
+ _unset : Any = object ()
92
+
91
93
def __init__ (self ) -> None :
92
94
self ._timeout : Optional [float ] = None
93
95
94
- def set_options (self , timeout : float = None ) -> None :
96
+ def set_options (self , timeout : Optional [ float ] = _unset ) -> None :
95
97
"""
96
98
This method sets global `expect()` options.
97
99
@@ -101,7 +103,7 @@ def set_options(self, timeout: float = None) -> None:
101
103
Returns:
102
104
None
103
105
"""
104
- if timeout is not None :
106
+ if timeout is not self . _unset :
105
107
self ._timeout = timeout
106
108
107
109
@overload
Original file line number Diff line number Diff line change 18
18
web automation that is ever-green, capable, reliable and fast.
19
19
"""
20
20
21
- from typing import Optional , Union , overload
21
+ from typing import Any , Optional , Union , overload
22
22
23
23
import playwright ._impl ._api_structures
24
24
import playwright ._impl ._api_types
@@ -88,10 +88,12 @@ def sync_playwright() -> PlaywrightContextManager:
88
88
89
89
90
90
class Expect :
91
+ _unset : Any = object ()
92
+
91
93
def __init__ (self ) -> None :
92
94
self ._timeout : Optional [float ] = None
93
95
94
- def set_options (self , timeout : float = None ) -> None :
96
+ def set_options (self , timeout : Optional [ float ] = _unset ) -> None :
95
97
"""
96
98
This method sets global `expect()` options.
97
99
@@ -101,7 +103,7 @@ def set_options(self, timeout: float = None) -> None:
101
103
Returns:
102
104
None
103
105
"""
104
- if timeout is not None :
106
+ if timeout is not self . _unset :
105
107
self ._timeout = timeout
106
108
107
109
@overload
You can’t perform that action at this time.
0 commit comments