Deprecate User.get_artist_tracks as Last.fm will remove it soon

This commit is contained in:
Hugo 2019-02-26 22:53:31 +02:00
parent 69b54e8c45
commit 9d125506e5
4 changed files with 25 additions and 6 deletions

View file

@ -3,6 +3,7 @@
Integration (not unit) tests for pylast.py
"""
import unittest
import warnings
import pylast
@ -44,7 +45,9 @@ class TestPyLastAlbum(TestPyLastWithLastFm):
lastfm_user = self.network.get_user(self.username)
# Act
track = lastfm_user.get_artist_tracks(artist="Test Artist")[0]
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
track = lastfm_user.get_artist_tracks(artist="Test Artist")[0]
# Assert
self.assertTrue(hasattr(track, "album"))