address review: replace assert in _auth with explicit RuntimeError

Assertions can be disabled at runtime, so use an explicit check and
raise instead — matches how driver creation failure is already handled.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Evan Rusackas
2026-04-22 12:35:42 -07:00
parent 776ab3cb14
commit 6b4ab27f01

View File

@@ -561,7 +561,8 @@ class WebDriverSelenium(WebDriverProxy):
def _auth(self, user: User) -> None:
"""Authenticate the persistent driver in-place."""
assert self._driver is not None
if self._driver is None:
raise RuntimeError("WebDriver is not initialized")
machine_auth_provider_factory.instance.authenticate_webdriver(
self._driver, user
)