INNER CODE UNIT · Python
_repo_frames
etchdroid/etchdroid · appium-tests/conftest.py:15
def _repo_frames(exc_tb) -> str:
"""The traceback entries that live in this repo (drops venv/pytest internals).
Their source lines carry the awaited xpath, so this is the "what was it waiting
for" context."""
out = []
for f in _tb.extract_tb(exc_tb):
if "/site-packages/" in f.filename or "/.venv/" in f.filename:
continue
if "appium-tests" not in f.filename:
continue
loc = f.filename.split("appium-tests/", 1)[-1]
out.append(f" {loc}:{f.lineno} in {f.name}\n {(f.line or '').strip()}")
return "\n".join(out) or " (no in-repo frames)"
def _exception_message(exc) -> str:
# Selenium's str() is multi-line and ends with a JS "at ..." stack; keep the