Skip to content

fix: replace assert with ValueError for state validation#1219

Merged
KazuCocoa merged 1 commit intoappium:masterfrom
Dor-bl:fix-security-assert-vulnerability-13839261523439253099
Apr 19, 2026
Merged

fix: replace assert with ValueError for state validation#1219
KazuCocoa merged 1 commit intoappium:masterfrom
Dor-bl:fix-security-assert-vulnerability-13839261523439253099

Conversation

@Dor-bl
Copy link
Copy Markdown
Contributor

@Dor-bl Dor-bl commented Apr 19, 2026

The use of assert for application logic or state checking is discouraged because assertions are removed when Python runs with optimization (-O). This change replaces assert self.caps with an explicit if check that raises ValueError, ensuring that the driver capabilities are always validated even in optimized environments.

The use of `assert` for application logic or state checking is discouraged because assertions are removed when Python runs with optimization (-O).
This change replaces `assert self.caps` with an explicit `if` check that raises `ValueError`, ensuring that the driver capabilities are always validated even in optimized environments.
@KazuCocoa KazuCocoa merged commit 2193837 into appium:master Apr 19, 2026
10 of 12 checks passed
@Dor-bl Dor-bl deleted the fix-security-assert-vulnerability-13839261523439253099 branch April 20, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants