Merge remote-tracking branch 'SyxbEaEQ2/rate-limit'
[youtube-dl] / test / helper.py
index 9a7f0746ec4ca02ed9f197395b8e48a1fffff38a..8a820526abfe5dbae31a1921312c60d075667c32 100644 (file)
@@ -161,7 +161,9 @@ def assertRegexpMatches(self, text, regexp, msg=None):
     else:
         m = re.match(regexp, text)
         if not m:
-            note = 'Regexp didn\'t match: %r not found in %r' % (regexp, text)
+            note = 'Regexp didn\'t match: %r not found' % (regexp)
+            if len(text) < 1000:
+                note += ' in %r' % text
             if msg is None:
                 msg = note
             else: