From 7f207c50da4bea73831f3be25cd48bc85c5eeea9 Mon Sep 17 00:00:00 2001 From: Hugo Date: Sun, 3 Feb 2019 13:55:54 +0200 Subject: [PATCH 1/2] Add a delay to allow Last.fm to update unloves --- tests/test_track.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_track.py b/tests/test_track.py index bce28db..f0d0620 100755 --- a/tests/test_track.py +++ b/tests/test_track.py @@ -2,6 +2,7 @@ """ Integration (not unit) tests for pylast.py """ +import time import unittest import pylast @@ -20,6 +21,7 @@ class TestPyLastTrack(TestPyLastWithLastFm): # Act track.love() + time.sleep(1) # Delay, for Last.fm latency. TODO Can this be removed later? # Assert loved = lastfm_user.get_loved_tracks(limit=1) From 0ad27dbc7ef221dc0667638a5de79d078b4578a7 Mon Sep 17 00:00:00 2001 From: Hugo Date: Sun, 3 Feb 2019 14:02:28 +0200 Subject: [PATCH 2/2] Only run test_unlove on a single Python version to avoid collisions --- tests/test_track.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_track.py b/tests/test_track.py index f0d0620..274d495 100755 --- a/tests/test_track.py +++ b/tests/test_track.py @@ -11,7 +11,6 @@ from .test_pylast import PY37, TestPyLastWithLastFm class TestPyLastTrack(TestPyLastWithLastFm): - @unittest.skipUnless(PY37, "Only run on Python 3.7 to avoid collisions") def test_love(self): # Arrange artist = "Test Artist" @@ -28,6 +27,7 @@ class TestPyLastTrack(TestPyLastWithLastFm): self.assertEqual(str(loved[0].track.artist).lower(), "test artist") self.assertEqual(str(loved[0].track.title).lower(), "test title") + @unittest.skipUnless(PY37, "Only run on Python 3.7 to avoid collisions") def test_unlove(self): # Arrange artist = pylast.Artist("Test Artist", self.network)