From 88c0a24db22d91a6d3ab9def0cd3676508e516c2 Mon Sep 17 00:00:00 2001 From: Harmon Date: Wed, 19 May 2021 10:38:22 -0500 Subject: [PATCH] Skip auth tests if consumer key and/or secret missing --- tests/test_auth.py | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- 2.25.1