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

tests/test_api.py
tests/test_cursors.py
tests/test_streaming.py

index e057c4421d67fba225d40c67163935d7376015c0..909b7df04c3df06d0408ed8e78749d5c54225b1e 100644 (file)
@@ -427,10 +427,10 @@ class TweepyAPITests(TweepyTestCase):
 
         user1 = self.api.get_user('TheTweepyTester')
         self.assertFalse(self.api.cached_result)
-        self.assertEquals('TheTweepyTester', user1.screen_name)
+        self.assertEqual('TheTweepyTester', user1.screen_name)
 
         user2 = self.api.get_user('tweepytest')
-        self.assertEquals('tweepytest', user2.screen_name)
+        self.assertEqual('tweepytest', user2.screen_name)
         self.assertFalse(self.api.cached_result)
 
 
index b707b34e5034052ab50ea4a67ce7afde88862d62..65fd9eeb01986812aed0f5f8d23921cdfb1152c4 100644 (file)
@@ -44,4 +44,4 @@ class TweepyCursorTests(TweepyTestCase):
         cursor = Cursor(self.api.user_timeline, id='twitter').items(5)
         status = cursor.next()
 
-        self.assertEquals(status.user.screen_name, 'twitter')
+        self.assertEqual(status.user.screen_name, 'twitter')
index 4c3020c85fef1fa74d2a288d847f5305fc0b8e1f..21e749d1c11a96071568dba39afe82ccd3b03122 100644 (file)
@@ -87,15 +87,15 @@ class TweepyStreamTests(unittest.TestCase):
     def test_sample(self):
         self.listener.status_stop_count = 10
         self.stream.sample()
-        self.assertEquals(self.listener.status_count,
-                          self.listener.status_stop_count)
+        self.assertEqual(self.listener.status_count,
+                         self.listener.status_stop_count)
 
     def test_filter_track(self):
         self.listener.status_stop_count = 5
         phrases = ['twitter']
         self.stream.filter(track=phrases)
-        self.assertEquals(self.listener.status_count,
-                          self.listener.status_stop_count)
+        self.assertEqual(self.listener.status_count,
+                         self.listener.status_stop_count)
 
     def test_track_encoding(self):
         s = Stream(None, None)