From 89bec483ce88fb1a310d4dd06220ace412148257 Mon Sep 17 00:00:00 2001 From: Harmon Date: Fri, 21 Jun 2019 14:00:06 -0500 Subject: [PATCH] Update auth tests to be compatible with Python 3 --- tests/test_auth.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_auth.py b/tests/test_auth.py index 961efc2..7ab8918 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -3,6 +3,8 @@ from __future__ import absolute_import import random import unittest +from six.moves import input + from .config import * from tweepy import API, OAuthHandler @@ -15,7 +17,7 @@ class TweepyAuthTests(unittest.TestCase): # test getting access token auth_url = auth.get_authorization_url() print('Please authorize: ' + auth_url) - verifier = raw_input('PIN: ').strip() + verifier = input('PIN: ').strip() self.assertTrue(len(verifier) > 0) access_token = auth.get_access_token(verifier) self.assertTrue(access_token is not None) @@ -29,5 +31,5 @@ class TweepyAuthTests(unittest.TestCase): auth = OAuthHandler(oauth_consumer_key, oauth_consumer_secret) auth_url = auth.get_authorization_url(access_type='read') print('Please open: ' + auth_url) - answer = raw_input('Did Twitter only request read permissions? (y/n) ') + answer = input('Did Twitter only request read permissions? (y/n) ') self.assertEqual('y', answer.lower()) -- 2.25.1