>=3.10 strict typing (#765)

* >=3.10 

* fully typed (mypy strict mode enabled)

* fix tests (get_tasteprofile now requires auth - serverside)

* update linters

* fix uploads search
This commit is contained in:
sigma67 2025-04-17 16:05:34 +02:00 • committed by GitHub
commit a979691bb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
47 changed files with 717 additions and 503 deletions

View file

@ -1,3 +1,5 @@
from typing import Any
import pytest
from ytmusicapi import YTMusic
@ -51,7 +53,7 @@ class TestSearch:
),
],
)
def test_search_album_artists(self, yt, case: tuple[str, dict]):
def test_search_album_artists(self, yt, case: tuple[str, dict[str, Any]]):
(query, expected) = case
results = yt.search(query, filter="albums")
@ -125,6 +127,9 @@ class TestSearch:
)
results = yt_oauth.search(config["queries"]["uploads_songs"], scope="uploads", limit=40)
assert len(results) > 20
assert all(isinstance(item["title"], str) for item in results)
assert all(item.get("browseId", None) or item.get("videoId", None) for item in results)
assert all(len(item["thumbnails"]) >= 2 for item in results)
def test_search_library(self, config, yt_oauth):
results = yt_oauth.search(config["queries"]["library_any"], scope="library")