Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install uv
run: make install-uv
- name: Run Checks
run: make check
- name: Run Unit Tests
run: uv run pytest test/unit
run: make unittest
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
.PHONY: Commands for developers

.PHONY: check-all
check-all: ## Run all lint checks and unittest
@echo "[Notice] If you'd like to run commands with same env to CI, please run \`tox\`."
@bash ci.sh
check-all: check unittest

.PHONY: check
check: check-lint check-format

.PHONY: check-lint
check-lint:
uv run ruff check .
uv run mypy appium

.PHONY: check-format
check-format:
Expand Down
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,18 +483,32 @@ or add it to PATH:
export "PATH=/venv/root/folder/bin:$PATH"
```

### Linting And Formatting

Run linter and format checks

```bash
make check
```

Address autofixable linter and formatting issues

```bash
make fix
```

### Testing

#### Unit

```bash
uv run pytest test/unit
make unittest
```

Run in parallel (2 threads)

```bash
uv run pytest -n 2 test/unit
make unittest ARGS="-n 2"
```

#### Functional
Expand Down
10 changes: 2 additions & 8 deletions appium/webdriver/switch_to.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Optional, Protocol
from typing import Optional

from selenium.webdriver.remote.switch_to import SwitchTo
from typing_extensions import Self

from appium.protocols.webdriver.can_execute_commands import CanExecuteCommands

from .mobilecommand import MobileCommand


class HasDriver(Protocol):
_driver: CanExecuteCommands


class MobileSwitchTo(SwitchTo, HasDriver):
class MobileSwitchTo(SwitchTo):
def context(self, context_name: Optional[str]) -> Self:
"""Sets the context for the current session.
Passing `None` is equal to switching to native context.
Expand Down
17 changes: 0 additions & 17 deletions ci.sh

This file was deleted.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@ dynamic = [
requires-python = ">=3.9"
dependencies = [
"selenium>=4.26,<5.0",
"typing-extensions~=4.13.2",
"typing-extensions~=4.13",
]

[tool.uv]
dev-dependencies = [
"httpretty~=1.1",
"mock~=5.2",
"mypy~=1.17",
"pre-commit~=4.2",
"pytest~=8.4",
"pytest-cov~=6.2",
"pytest-xdist~=3.8",
"python-dateutil~=2.9",
"ruff~=0.12.7",
"ruff~=0.12",
"types-python-dateutil~=2.9",
]

Expand Down
75 changes: 73 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.