* update dev-dependencies

* fix INP001

* fix #721

* add test

* format
This commit is contained in:
sigma67 2025-01-17 18:56:07 +01:00 • committed by GitHub
commit e41e1a37d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 284 additions and 277 deletions

View file

@ -85,9 +85,9 @@ class TestUploads:
# Now re-upload
upload_response = yt_auth.upload_song(get_resource(config["uploads"]["file"]))
assert (
upload_response == ResponseStatus.SUCCEEDED or upload_response.status_code == 200
), f"Song failed to upload {upload_response}"
assert upload_response == ResponseStatus.SUCCEEDED or upload_response.status_code == 200, (
f"Song failed to upload {upload_response}"
)
# Wait for upload to finish processing and verify it can be retrieved
retries_remaining = 5

0
tests/setup/__init__.py Normal file
View file

View file

@ -1,6 +1,14 @@
import pytest
from ytmusicapi import YTMusic
from ytmusicapi.exceptions import YTMusicUserError
def test_ytmusic_context():
with YTMusic(requests_session=False) as yt:
assert isinstance(yt, YTMusic)
def test_ytmusic_auth_error():
with pytest.raises(YTMusicUserError, match="Invalid auth"):
YTMusic(auth="def")