Skip to content

fix(tests): fix mypy errors in test_basic.py and reuse utils helpers - #913

Merged
cloudwebrtc merged 2 commits into
mainfrom
fix/test-basic-mypy
Oct 30, 2026
Merged

cloudwebrtc merged 2 commits into
mainfrom
fix/test-basic-mypy

Conversation

@cloudwebrtc

@cloudwebrtc cloudwebrtc commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Check Types fails on main since #641 (run):

livekit-rtc/tests/test_basic.py:29: error: Function is missing a return type annotation  [no-untyped-def]
livekit-rtc/tests/test_basic.py:111: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
livekit-rtc/tests/test_basic.py:142: error: Call to untyped function "skip_if_no_credentials" in typed context  [no-untyped-call]
livekit-rtc/tests/test_basic.py:142: error: Untyped decorator makes function "test_connection_basics" untyped  [untyped-decorator]
  • test_basic.py re-implemented helpers that already live in tests/utils.py. It now imports skip_if_no_credentials, create_token, unique_room_name, wait_until, connect_room, ensure_rooms_all_connected, ensure_track_subscribed, expect_room_event and await_event from there, like test_dc.py does, which also removes the untyped definitions
  • Behavior differences from the local copies: default wait timeout is 30s instead of 20s, event handlers are unregistered once they fire, and a track counts as subscribed only once pub.track is set

Test-only change, so no changeset. uv run mypy livekit-protocol livekit-api livekit-rtc and ruff pass locally; the E2E test itself was not run (no LiveKit credentials locally).

🤖 Generated with Claude Code

mypy (Check Types) failed on main after #641 with no-untyped-def,
no-untyped-call and untyped-decorator errors. Annotate
skip_if_no_credentials() like tests/utils.py does, and type the
event callback's *args/**kwargs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

👋 This PR has no changeset. If it should be released, add a markdown file under .changeset/ (any name, e.g. .changeset/fix-token-parsing.md):

---
"livekit-rtc": patch
---

Short description of the change, used in the release notes.
  • Packages: livekit-rtc, livekit-api, livekit-protocol (one line per package)
  • Types: patch, minor, major, patch-rc, minor-rc, major-rc, next-rc, promote

If this change doesn't need a release (docs, CI, tests), you can ignore this comment.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Replace the local copies of skip_if_no_credentials, create_token,
unique_room_name and the wait/connect/event helpers with the shared ones
in tests/utils.py. expect_room_event now unregisters its handler once
the event fires.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudwebrtc cloudwebrtc changed the title fix(tests): add missing type annotations in test_basic.py fix(tests): fix mypy errors in test_basic.py and reuse utils helpers Oct 30, 2026
@cloudwebrtc
cloudwebrtc merged commit 7f60f35 into main Oct 30, 2026
33 of 48 checks passed
@cloudwebrtc
cloudwebrtc deleted the fix/test-basic-mypy branch October 30, 2026 01:34
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