mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 17:23:53 +00:00
Fixed lint issues
This commit is contained in:
parent
c8e045891b
commit
701dc383ea
@ -195,7 +195,6 @@ class Spotify:
|
|||||||
else: # Use the Requests API module as a "session".
|
else: # Use the Requests API module as a "session".
|
||||||
self._session = requests.api
|
self._session = requests.api
|
||||||
|
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
"""Make sure the connection (pool) gets closed"""
|
"""Make sure the connection (pool) gets closed"""
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -11,6 +11,7 @@ from spotipy import (
|
|||||||
import unittest
|
import unittest
|
||||||
from tests import helpers
|
from tests import helpers
|
||||||
|
|
||||||
|
|
||||||
def _make_spotify(scopes=None, retries=None):
|
def _make_spotify(scopes=None, retries=None):
|
||||||
|
|
||||||
retries = retries or Spotify.max_retries
|
retries = retries or Spotify.max_retries
|
||||||
@ -27,6 +28,7 @@ def _make_spotify(scopes=None, retries=None):
|
|||||||
|
|
||||||
return spotify
|
return spotify
|
||||||
|
|
||||||
|
|
||||||
class SpotipyPlaylistApiTest(unittest.TestCase):
|
class SpotipyPlaylistApiTest(unittest.TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
@ -66,7 +68,6 @@ class SpotipyPlaylistApiTest(unittest.TestCase):
|
|||||||
cls.spotify = _make_spotify(scopes=scope)
|
cls.spotify = _make_spotify(scopes=scope)
|
||||||
cls.spotify_no_retry = _make_spotify(scopes=scope, retries=0)
|
cls.spotify_no_retry = _make_spotify(scopes=scope, retries=0)
|
||||||
|
|
||||||
|
|
||||||
cls.new_playlist_name = 'spotipy-playlist-test'
|
cls.new_playlist_name = 'spotipy-playlist-test'
|
||||||
cls.new_playlist = helpers.get_spotify_playlist(
|
cls.new_playlist = helpers.get_spotify_playlist(
|
||||||
cls.spotify, cls.new_playlist_name, cls.username) or \
|
cls.spotify, cls.new_playlist_name, cls.username) or \
|
||||||
|
|||||||
@ -6,10 +6,9 @@ import unittest.mock as mock
|
|||||||
import urllib.parse as urllibparse
|
import urllib.parse as urllibparse
|
||||||
|
|
||||||
from spotipy import SpotifyOAuth, SpotifyPKCE
|
from spotipy import SpotifyOAuth, SpotifyPKCE
|
||||||
from spotipy.cache_handler import CacheHandler
|
|
||||||
from spotipy.oauth2 import SpotifyClientCredentials, SpotifyOauthError
|
from spotipy.oauth2 import SpotifyClientCredentials, SpotifyOauthError
|
||||||
from spotipy.oauth2 import SpotifyStateError
|
from spotipy.oauth2 import SpotifyStateError
|
||||||
from spotipy import CacheFileHandler
|
from spotipy import MemoryCacheHandler, CacheFileHandler
|
||||||
|
|
||||||
patch = mock.patch
|
patch = mock.patch
|
||||||
DEFAULT = mock.DEFAULT
|
DEFAULT = mock.DEFAULT
|
||||||
@ -228,6 +227,7 @@ class TestSpotifyClientCredentials(unittest.TestCase):
|
|||||||
oauth.get_access_token(check_cache=False)
|
oauth.get_access_token(check_cache=False)
|
||||||
self.assertEqual(error.exception.error, 'invalid_client')
|
self.assertEqual(error.exception.error, 'invalid_client')
|
||||||
|
|
||||||
|
|
||||||
class SpotifyPKCECacheTest(unittest.TestCase):
|
class SpotifyPKCECacheTest(unittest.TestCase):
|
||||||
|
|
||||||
@patch.multiple(SpotifyPKCE,
|
@patch.multiple(SpotifyPKCE,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user