Merge remote-tracking branch 'upstream/master' into streaming

This commit is contained in:
Hugo van Kemenade 2020-12-29 21:38:44 +02:00
commit 10107a04e4
23 changed files with 333 additions and 359 deletions

View file

@ -6,14 +6,15 @@ import os
import sys
import time
import pylast
import pytest
from flaky import flaky
import pylast
WRITE_TEST = sys.version_info[:2] == (3, 8)
def load_secrets():
def load_secrets(): # pragma: no cover
secrets_file = "test_pylast.yaml"
if os.path.isfile(secrets_file):
import yaml # pip install pyyaml
@ -33,14 +34,19 @@ def load_secrets():
class PyLastTestCase:
def assert_startswith(self, str, prefix, start=None, end=None):
assert str.startswith(prefix, start, end)
def assert_startswith(self, s, prefix, start=None, end=None):
assert s.startswith(prefix, start, end)
def assert_endswith(self, str, suffix, start=None, end=None):
assert str.endswith(suffix, start, end)
def assert_endswith(self, s, suffix, start=None, end=None):
assert s.endswith(suffix, start, end)
@flaky(max_runs=3, min_passes=1)
def _no_xfail_rerun_filter(err, name, test, plugin):
for _ in test.iter_markers(name="xfail"):
return False
@flaky(max_runs=3, min_passes=1, rerun_filter=_no_xfail_rerun_filter)
class TestPyLastWithLastFm(PyLastTestCase):
secrets = None