From: Harmon Date: Wed, 19 May 2021 15:38:22 +0000 (-0500) Subject: Skip auth tests if consumer key and/or secret missing X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=88c0a24db22d91a6d3ab9def0cd3676508e516c2;p=tweepy.git Skip auth tests if consumer key and/or secret missing --- diff --git a/tests/test_auth.py b/tests/test_auth.py index 5f875ef..aa7d77e 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -8,6 +8,9 @@ from tweepy import API, OAuthHandler class TweepyAuthTests(unittest.TestCase): def testoauth(self): + if not consumer_key or not consumer_secret: + self.skipTest("Missing consumer key and/or secret") + auth = OAuthHandler(consumer_key, consumer_secret) # test getting access token @@ -24,6 +27,9 @@ class TweepyAuthTests(unittest.TestCase): api.destroy_status(s.id) def testaccesstype(self): + if not consumer_key or not consumer_secret: + self.skipTest("Missing consumer key and/or secret") + auth = OAuthHandler(consumer_key, consumer_secret) auth_url = auth.get_authorization_url(access_type='read') print('Please open: ' + auth_url)