Fixing tests. It seems master changed something in the warnings. (#9483)

Trying to keep warning tests for now. Should be discarded if it becomes
too hard to maintain.
This commit is contained in:
Nicolas Patry 2021-01-10 15:08:20 +01:00 committed by GitHub
parent 1c19b423bf
commit 96f1f74aaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -134,10 +134,10 @@ class SimpleConversationPipelineTests(unittest.TestCase):
generated_responses=["b"],
)
with self.assertLogs("transformers", level="WARNING") as log:
_ = conversation_agent(conversation, max_length=60)
_ = conversation_agent(conversation, max_length=64)
self.assertEqual(len(log.output), 3)
self.assertIn("Cutting history off because it's too long (63 > 28) for underlying model", log.output[0])
self.assertIn("63 is bigger than 0.9 * max_length: 60", log.output[1])
self.assertIn("Cutting history off because it's too long (63 > 32) for underlying model", log.output[0])
self.assertIn("63 is bigger than 0.9 * max_length: 64", log.output[1])
self.assertIn("Setting `pad_token_id`", log.output[2])
self.assertEqual(conversation._index, 1)
self.assertEqual(