Merge pull request #292 from pylast/shuffle-test-order

Fix the build
This commit is contained in:
Hugo 2019-02-03 13:38:40 +02:00 committed by GitHub
commit d7750d8131
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 3 deletions

View file

@ -7,10 +7,11 @@ import unittest
import pylast import pylast
from .test_pylast import TestPyLastWithLastFm from .test_pylast import PY37, TestPyLastWithLastFm
class TestPyLastNetwork(TestPyLastWithLastFm): class TestPyLastNetwork(TestPyLastWithLastFm):
@unittest.skipUnless(PY37, "Only run on Python 3.7 to avoid collisions")
def test_scrobble(self): def test_scrobble(self):
# Arrange # Arrange
artist = "test artist" artist = "test artist"
@ -20,6 +21,7 @@ class TestPyLastNetwork(TestPyLastWithLastFm):
# Act # Act
self.network.scrobble(artist=artist, title=title, timestamp=timestamp) self.network.scrobble(artist=artist, title=title, timestamp=timestamp)
time.sleep(1) # Delay, for Last.fm latency. TODO Can this be removed later?
# Assert # Assert
# limit=2 to ignore now-playing: # limit=2 to ignore now-playing:

View file

@ -3,6 +3,7 @@
Integration (not unit) tests for pylast.py Integration (not unit) tests for pylast.py
""" """
import os import os
import sys
import time import time
import unittest import unittest
@ -12,6 +13,9 @@ from flaky import flaky
import pylast import pylast
PY37 = sys.version_info[:2] == (3, 7)
def load_secrets(): def load_secrets():
secrets_file = "test_pylast.yaml" secrets_file = "test_pylast.yaml"
if os.path.isfile(secrets_file): if os.path.isfile(secrets_file):

View file

@ -6,10 +6,11 @@ import unittest
import pylast import pylast
from .test_pylast import TestPyLastWithLastFm from .test_pylast import PY37, TestPyLastWithLastFm
class TestPyLastTrack(TestPyLastWithLastFm): class TestPyLastTrack(TestPyLastWithLastFm):
@unittest.skipUnless(PY37, "Only run on Python 3.7 to avoid collisions")
def test_love(self): def test_love(self):
# Arrange # Arrange
artist = "Test Artist" artist = "Test Artist"

View file

@ -14,8 +14,9 @@ deps =
mock mock
ipdb ipdb
pytest-cov pytest-cov
pytest-random-order
flaky flaky
commands = pytest -v -s -W all --cov pylast --cov-report term-missing {posargs} commands = pytest -v -s -W all --cov pylast --cov-report term-missing --random-order {posargs}
[testenv:venv] [testenv:venv]
deps = ipdb deps = ipdb