• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

berserkhmdvhb / agentic-scraper / 17350471794 / 3
87%
main: 88%

Build:
Build:
LAST BUILD BRANCH: docs/modules-funcs
DEFAULT BRANCH: main
Ran 31 Aug 2025 12:45AM UTC
Files 138
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

31 Aug 2025 12:43AM UTC coverage: 59.163% (+0.6%) from 58.581%
17350471794.3

push

github

berserkhmdvhb
refactor(agents.llm_fixed): improve safety, logging, and test coverage

Main code changes:
- Moved `Settings` and `ScrapeRequest` imports into TYPE_CHECKING blocks
  to satisfy ruff TC001 and reduce runtime dependencies.
- Wrapped OpenAI `AsyncOpenAI` import in a safe try/except ImportError with a
  minimal stub (`Chat`, `Completions`) for monkeypatch-based testing.
- Unified `AsyncOpenAI` binding to avoid mypy redefinition errors and support
  test stubbing consistently.
- Replaced inline log/raise strings with constants from config/messages
  (empty response, validation failure, unexpected errors, success).
- Cleaned up stub classes: used CapWords naming (`Chat`, `Completions`) and
  explicit parameters instead of `*args`/`**kwargs`, resolving ruff ANN401/N801.
- Raised exceptions using constants/variables instead of inline literals,
  fixing ruff EM101/TRY003.
- Structured `_extract_impl` flow with logging and return inside `else` block,
  resolving ruff TRY300.

Test changes:
- Added `tests/backend/scraper/agents/test_llm_fixed.py` with async unit tests
  covering success, screenshot enabled, empty content, and error handling cases.
- Implemented fake AsyncOpenAI client, chat, completions, and response objects
  to simulate OpenAI SDK behavior deterministically.
- Patched `capture_optional_screenshot` safely (non-temp path) to verify
  screenshot integration without triggering filesystem warnings.
- Used caplog/capsys assertions consistently to check logger output when
  responses are empty or errors are raised.
- Treated injected `_BoomError` as `OpenAIErrorT` to test exception handling
  branch in `extract_structured_data`.

5372 of 9080 relevant lines covered (59.16%)

0.59 hits per line

Source Files on job 17350471794.3
  • Tree
  • List 138
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 17350471794
  • 32af98c3 on github
  • Prev Job for on infra/unit-tests (#17349854085.3)
  • Next Job for on infra/unit-tests (#17353807333.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc