From a0064393b86376a04d89c25f66e4c67d4059fefb Mon Sep 17 00:00:00 2001 From: Harmon Date: Fri, 21 Jun 2019 13:41:36 -0500 Subject: [PATCH] Replace deprecated assert_ in tests With assertTrue https://docs.python.org/3/library/unittest.html#deprecated-aliases --- tests/test_api.py | 4 ++-- tests/test_auth.py | 4 ++-- tests/test_cursors.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index 909b7df..3155750 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -188,8 +188,8 @@ class TweepyAPITests(TweepyTestCase): @tape.use_cassette('testshowfriendship.json') def testshowfriendship(self): source, target = self.api.show_friendship(target_screen_name='twitter') - self.assert_(isinstance(source, Friendship)) - self.assert_(isinstance(target, Friendship)) + self.assertTrue(isinstance(source, Friendship)) + self.assertTrue(isinstance(target, Friendship)) @tape.use_cassette('testfriendsids.json') def testfriendsids(self): diff --git a/tests/test_auth.py b/tests/test_auth.py index cc889fb..961efc2 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -16,9 +16,9 @@ class TweepyAuthTests(unittest.TestCase): auth_url = auth.get_authorization_url() print('Please authorize: ' + auth_url) verifier = raw_input('PIN: ').strip() - self.assert_(len(verifier) > 0) + self.assertTrue(len(verifier) > 0) access_token = auth.get_access_token(verifier) - self.assert_(access_token is not None) + self.assertTrue(access_token is not None) # build api object test using oauth api = API(auth) diff --git a/tests/test_cursors.py b/tests/test_cursors.py index 65fd9ee..4aeb0d1 100644 --- a/tests/test_cursors.py +++ b/tests/test_cursors.py @@ -24,10 +24,10 @@ class TweepyCursorTests(TweepyTestCase): @tape.use_cassette('testcursorcursorpages.json') def testcursorcursorpages(self): pages = list(Cursor(self.api.friends_ids).pages(1)) - self.assert_(len(pages) == 1) + self.assertTrue(len(pages) == 1) pages = list(Cursor(self.api.followers_ids, username).pages(1)) - self.assert_(len(pages) == 1) + self.assertTrue(len(pages) == 1) @tape.use_cassette('testcursorsetstartcursor.json') def testcursorsetstartcursor(self): -- 2.25.1