Skip to content

Commit db035dd

Browse files
chore(deps): update mypy requirement from ~=0.800 to ~=0.812 (appium#589)
* chore(deps): update mypy requirement from ~=0.800 to ~=0.812 Updates the requirements on [mypy](https://github.com/python/mypy) to permit the latest version. - [Release notes](https://github.com/python/mypy/releases) - [Commits](python/mypy@v0.800...v0.812) Signed-off-by: dependabot[bot] <support@github.com> * Fix mypy error with mypy v0.812 (appium#590) * chore(deps): update mypy requirement from ~=0.800 to ~=0.812 Updates the requirements on [mypy](https://github.com/python/mypy) to permit the latest version. - [Release notes](https://github.com/python/mypy/releases) - [Commits](python/mypy@v0.800...v0.812) Signed-off-by: dependabot[bot] <support@github.com> * fix mypy error * review comment Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mori Atsushi <ki4070ma@gmail.com>
1 parent 8eb4c3f commit db035dd

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ pylint = "~=2.6"
2424
astroid = "~=2.4"
2525
isort = "~=5.7"
2626

27-
mypy = "~=0.800"
27+
mypy = "~=0.812"

appium/webdriver/switch_to.py

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

15-
from typing import TypeVar
15+
from typing import Optional, TypeVar
1616

1717
from selenium.webdriver.remote.switch_to import SwitchTo
1818

@@ -22,8 +22,9 @@
2222

2323

2424
class MobileSwitchTo(SwitchTo):
25-
def context(self, context_name: str) -> T:
25+
def context(self, context_name: Optional[str]) -> T:
2626
"""Sets the context for the current session.
27+
Passing `None` is equal to switching to native context.
2728
2829
Args:
2930
context_name: The name of the context to switch to.

appium/webdriver/webdriver.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ def __init__(
160160
self._addCommands()
161161

162162
self.error_handler = MobileErrorHandler()
163-
self._switch_to = MobileSwitchTo(self)
164163

165164
if direct_connection:
166165
self._update_command_executor(keep_alive=keep_alive)
@@ -344,6 +343,19 @@ def set_value(self, element: MobileWebElement, value: str) -> T:
344343
self.execute(Command.SET_IMMEDIATE_VALUE, data)
345344
return self
346345

346+
@property
347+
def switch_to(self) -> MobileSwitchTo:
348+
"""Returns an object containing all options to switch focus into
349+
350+
Override for appium
351+
352+
Returns:
353+
`appium.webdriver.switch_to.MobileSwitchTo`
354+
355+
"""
356+
357+
return MobileSwitchTo(self)
358+
347359
# pylint: disable=protected-access
348360

349361
def _addCommands(self) -> None:

0 commit comments

Comments
 (0)