Skip to content

Commit 8228005

Browse files
authored
Uncomment and add deprecation warnings for unimplemented methods
Added deprecation warnings for unimplemented methods in CanExecuteScripts protocol.
1 parent 8b1ed55 commit 8228005

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

appium/protocols/webdriver/can_execute_scripts.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,24 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import Any, List, Optional, Protocol
15+
from typing import Any, List, Optional, Protocol, TYPE_CHECKING
16+
from warings import deprecated
1617

1718

1819
class CanExecuteScripts(Protocol):
1920
def execute_script(self, script: str, *args: Any) -> Any: ...
2021

21-
# TODO: Implement them later
22-
# def pin_script(self, script: str, script_key: Optional[Any] = None) -> Any: ...
23-
# def unpin(self, script_key: Any) -> None: ...
24-
# def get_pinned_scripts(self) -> List[str]: ...
25-
# def execute_async_script(self, script: str, *args: Any) -> Any: ...
22+
# TODO: remove `if not TYPE_CHECKING` guard after properly implement them
23+
# The use of these methods will produce DeprecationWarnings at runtime
24+
if not TYPE_CHECKING:
25+
@deprecated("pin_script is not yet implemented")
26+
def pin_script(self, script: str, script_key: Optional[Any] = None) -> Any: ...
27+
28+
@deprecated("unpin is not yet implemented")
29+
def unpin(self, script_key: Any) -> None: ...
30+
31+
@deprecated("get_pinned_scripts is not yet implemented")
32+
def get_pinned_scripts(self) -> List[str]: ...
33+
34+
@deprecated("execute_async_script is not yet implemented")
35+
def execute_async_script(self, script: str, *args: Any) -> Any: ...

0 commit comments

Comments
 (0)