Skip to content

test: skip podcast search results without a browseId - #976

Merged
sigma67 merged 1 commit into
mainfrom
fix/tolerate-podcast-search-missing-browse-id
Aug 8, 2026
Merged

test: skip podcast search results without a browseId#976
sigma67 merged 1 commit into
mainfrom
fix/tolerate-podcast-search-missing-browse-id

Conversation

@sigma67

@sigma67 sigma67 commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • test_many_podcasts calls yt.search("europe", filter="podcasts") and passes every result's browseId straight into get_podcast().
  • Search with the podcasts filter can surface results (e.g. episodes) that don't have a browseId, since ytmusicapi/parsers/search.py:65 reads it with none_if_absent=True.
  • When that happens, get_podcast(None) raises AttributeError: 'NoneType' object has no attribute 'startswith' in ytmusicapi/mixins/podcasts.py:136, failing CI (seen on PR Expose ownership for library playlists #972: https://github.com/sigma67/ytmusicapi/actions/runs/31269845020/job/93133837902).
  • test_many_episodes right below already tolerates a similar case (episodes that are no longer available); this applies the same pattern here.

Test plan

  • ruff check / ruff format / mypy pass via pre-commit hooks
  • CI run passes (live API test, can't be run locally without credentials)

The podcasts search filter can surface non-podcast results (e.g. episodes)
that lack a browseId, causing get_podcast() to crash with an AttributeError.
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.81%. Comparing base (aa766e5) to head (91d8ef3).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #976      +/-   ##
==========================================
+ Coverage   95.77%   95.81%   +0.03%     
==========================================
  Files          47       47              
  Lines        2723     2723              
==========================================
+ Hits         2608     2609       +1     
+ Misses        115      114       -1     
Flag Coverage Δ
unittests 95.81% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@sigma67
sigma67 merged commit 488d39b into main Aug 8, 2026
8 checks passed
This was referenced Aug 10, 2026
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.

1 participant