INNER CODE UNIT · Python

_exception_message

etchdroid/etchdroid · appium-tests/conftest.py:31

def _exception_message(exc) -> str:
    # Selenium's str() is multi-line and ends with a JS "at ..." stack; keep the
    # meaningful lines (e.g. the NoSuchElementError reason) and drop the JS frames.
    # Harmless for plain Python exceptions (single-line str).
    lines = [
        ln.strip()
        for ln in str(exc).splitlines()
        if ln.strip() and not ln.strip().startswith("at ") and ln.strip() not in ("Message:", "Stacktrace:")
    ]
    return " ".join(lines).strip() or exc.__class__.__name__


def _denoised_logcat(name: str) -> str:
    if not Config.LOGCAT_DIR:
        return "(LOGCAT_DIR not configured; no logcat captured)"
    path = Path(Config.LOGCAT_DIR) / f"{name}.app.denoised.log"
    try:
        text = path.read_text(errors="replace").strip()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…