Skip to content

Commit 642f99b

Browse files
committed
continuing to debug periodically failing unit test that fails because the playlist sometimes has a song count that is higher than the number of songs that get added to history
1 parent 5804d2f commit 642f99b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/conftest.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,19 @@ def fixture_get_playlist_with_dupes(yt_oauth: YTMusic, sample_song_list_dupes):
335335
def fixture_add_history_items(yt_oauth: YTMusic, sample_long_song_list):
336336
num_songs_added = 0
337337
print(f"total songs to be added to history: {len(sample_long_song_list)}")
338+
print(sample_long_song_list)
338339
for song in sample_long_song_list:
339340
song = yt_oauth.get_song(song, yt_oauth.get_signatureTimestamp())
340341
try:
342+
print(f"Adding {song['videoDetails']['title']!r} to history...")
341343
response = yt_oauth.add_history_item(song)
342344
response.raise_for_status()
343-
except KeyError:
345+
except Exception as e:
346+
print(e)
344347
print("skipping a song that couldn't be added to history...")
345348
continue
346349
assert response.status_code == 204
350+
print(f"Added {song['videoDetails']['title']!r} to history...")
347351
num_songs_added += 1
348352
print(f"total songs added to history so far: {num_songs_added}")
349353
print(f"{num_songs_added} were added to history successfully")

0 commit comments

Comments
 (0)