Replace deprecated assert_ in tests
authorHarmon <Harmon758@gmail.com>
Fri, 21 Jun 2019 18:41:36 +0000 (13:41 -0500)
committerHarmon <Harmon758@gmail.com>
Fri, 21 Jun 2019 18:41:36 +0000 (13:41 -0500)
With assertTrue
https://docs.python.org/3/library/unittest.html#deprecated-aliases

tests/test_api.py
tests/test_auth.py
tests/test_cursors.py

index 909b7df04c3df06d0408ed8e78749d5c54225b1e..3155750f3e961b90c7c0b9e57029a7d47b2d64b7 100644 (file)
@@ -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):
index cc889fbc867b33a8a8776fa5fc7957adf2855cb6..961efc2d91bbf7355c92308c53f15b8d07e92090 100644 (file)
@@ -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)
index 65fd9eeb01986812aed0f5f8d23921cdfb1152c4..4aeb0d16e8abc386f22687953a217a0d09e4e836 100644 (file)
@@ -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):