Extract shared core from MCP tools, add CLI browser commands (#4768)

This commit is contained in:
Marc Kelechava
2026-02-17 11:24:56 -08:00
committed by GitHub
parent aacc612365
commit 7c5be8fefe
14 changed files with 1304 additions and 113 deletions

View File

@@ -0,0 +1,37 @@
from __future__ import annotations
import logging
import skyvern.cli.commands as cli_commands
def test_configure_cli_logging_is_idempotent(monkeypatch) -> None:
setup_calls: list[str] = []
monkeypatch.setattr(cli_commands, "_setup_logger", lambda: setup_calls.append("called"))
monkeypatch.setattr(cli_commands, "_cli_logging_configured", False)
logger_names = ("skyvern", "httpx", "litellm", "playwright", "httpcore")
previous_levels = {name: logging.getLogger(name).level for name in logger_names}
try:
cli_commands.configure_cli_logging()
assert setup_calls == ["called"]
for name in logger_names:
assert logging.getLogger(name).level == logging.WARNING
cli_commands.configure_cli_logging()
assert setup_calls == ["called"]
finally:
for name, level in previous_levels.items():
logging.getLogger(name).setLevel(level)
def test_cli_callback_configures_logging(monkeypatch) -> None:
called = False
def _fake_configure() -> None:
nonlocal called
called = True
monkeypatch.setattr(cli_commands, "configure_cli_logging", _fake_configure)
cli_commands.cli_callback()
assert called