Skip to content

test(python): add e2e tests for llm.call for multiple image formats#2529

Open
samyak1729 wants to merge 9 commits intoMirascope:mainfrom
samyak1729:test/e2e-mimetype-image-content
Open

test(python): add e2e tests for llm.call for multiple image formats#2529
samyak1729 wants to merge 9 commits intoMirascope:mainfrom
samyak1729:test/e2e-mimetype-image-content

Conversation

@samyak1729
Copy link

Add E2E tests for llm.call with multiple image formats

Summary

Expands the existing image E2E tests (test_call_with_image_content and test_call_with_image_url) from a single PNG-only test to parametrized tests covering all supported MIME types: PNG, JPEG, WebP, GIF, HEIC, and HEIF.

Changes

  • test_call_with_image.py: Parametrize both test_call_with_image_content and test_call_with_image_url over MIME_TYPES, with per-provider skip logic for unsupported formats (e.g., HEIC/HEIF on OpenAI/Anthropic, GIF on Google). Added test asset paths and URLs for each format.
  • conftest.py: Generalized the cassette/snapshot path generation to support arbitrary extra parametrized segments (mime_type, formatting_mode) via _get_extra_segments, replacing the previous formatting_mode-only logic.
  • Assets: Added test images (test.jpg, test.webp, test.gif, test.heic, test.heif) and renamed wikipedia.pngtest.png.
  • Cassettes & Snapshots: Added new VCR cassettes and snapshot files for each image format/provider combination, and removed stale ones (e.g., OpenAI completions/responses cassettes that are no longer used).

Testing

I only had access to a Google API key while working on this, so VCR cassettes and inline snapshots have been generated for google/gemini-2.5-flash. Everything is passing on that end.

However, the Anthropic and OpenAI cassettes still need to be recorded. If maintainers with those keys could run the following, that should take care of it:

uv run pytest tests/e2e/input/test_call_with_image.py --inline-snapshot=create

The test logic itself is provider-agnostic, so I don't expect any surprises.

@samyak1729 samyak1729 changed the title add e2e tests for llm.call for multiple image formats test(python): add e2e tests for llm.call for multiple image formats Feb 10, 2026
teamdandelion and others added 2 commits February 10, 2026 05:27
- Regenerated all Anthropic and OpenAI cassettes with valid API keys
- Skip OpenAI image URL tests (external URLs blocked by OpenAI)
- Added missing snapshots for all providers and image formats

Co-authored-by: samyak <samyak5jan@gmail.com>
samyak1729 and others added 5 commits February 11, 2026 00:32
…nations

- Replace pytest.skip() calls with custom parametrization that excludes
  unsupported model/mime-type combinations entirely
- This prevents the snapshot fixture from importing empty snapshot modules
  that cause inline_snapshot AssertionError at import time
- Delete empty snapshot files for unsupported combinations
- Delete corresponding VCR cassette files for unsupported combinations
- Fixes all 'ERROR at setup' failures in Python e2e image tests
Copy link
Author

@samyak1729 samyak1729 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally with

CI=true uv run pytest --cov --cov-config=.coveragerc --cov-report=xml --cov-report=term-missing.

Everything looks great and tests are passing with 100% coverage. Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants