From 37709b59099bd984858ca1884c6c70403420347d Mon Sep 17 00:00:00 2001 From: Kevin Canwen Xu Date: Mon, 17 Aug 2020 17:13:58 +0800 Subject: [PATCH] Remove deprecated assertEquals (#6532) `assertEquals` is deprecated: https://stackoverflow.com/questions/930995/assertequals-vs-assertequal-in-python/931011 This PR replaces these deprecated methods. --- tests/test_tokenization_fast.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_tokenization_fast.py b/tests/test_tokenization_fast.py index 9cd45c7e34..399aae8b78 100644 --- a/tests/test_tokenization_fast.py +++ b/tests/test_tokenization_fast.py @@ -807,10 +807,10 @@ class RobertaFastTokenizerTest(CommonFastTokenizerTest): self.assertSequenceEqual(tokens_p["input_ids"], [0, 250, 6, 50264, 3823, 487, 21992, 3645, 4, 2]) # token_type_ids should put 0 everywhere - self.assertEquals(sum(tokens_r["token_type_ids"]), sum(tokens_p["token_type_ids"])) + self.assertEqual(sum(tokens_r["token_type_ids"]), sum(tokens_p["token_type_ids"])) # attention_mask should put 1 everywhere, so sum over length should be 1 - self.assertEquals( + self.assertEqual( sum(tokens_r["attention_mask"]) / len(tokens_r["attention_mask"]), sum(tokens_p["attention_mask"]) / len(tokens_p["attention_mask"]), )