From 7fb97ed00e8484adb7340fa61d1b33b5ec4e1782 Mon Sep 17 00:00:00 2001 From: Stephane Bruckert Date: Thu, 16 Jan 2020 23:30:40 +0000 Subject: [PATCH] No warning in python2 --- tests/test_auth.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_auth.py b/tests/test_auth.py index ac3e3c6..0f6ef16 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -62,10 +62,12 @@ class AuthTestSpotipy(unittest.TestCase): @classmethod def setUpClass(self): - warnings.filterwarnings( - "ignore", - category=ResourceWarning, - message="unclosed.*") + if sys.version_info >= (3, 2): + # >= Python3.2 only + warnings.filterwarnings( + "ignore", + category=ResourceWarning, + message="unclosed.*") missing = list(filter(lambda var: not os.getenv(CCEV[var]), CCEV))