]> gitweb @ CieloNegro.org - youtube-dl.git/blobdiff - test/test_download.py
XHamster: Can't see the description anywhere in the UI
[youtube-dl.git] / test / test_download.py
index e29092c456b3d08c7e96c7cf35aae858118fd325..565b1ebc55b89fda6cf084b6790e750c2ba35a19 100644 (file)
@@ -43,6 +43,9 @@ class FileDownloader(youtube_dl.FileDownloader):
         self.to_stderr = self.to_screen
         self.processed_info_dicts = []
         return youtube_dl.FileDownloader.__init__(self, *args, **kwargs)
+    def report_warning(self, message):
+        # Don't accept warnings during tests
+        raise ExtractorError(message)
     def process_info(self, info_dict):
         self.processed_info_dicts.append(info_dict)
         return youtube_dl.FileDownloader.process_info(self, info_dict)
@@ -58,6 +61,7 @@ with io.open(PARAMETERS_FILE, encoding='utf-8') as pf:
 
 
 class TestDownload(unittest.TestCase):
+    maxDiff = None
     def setUp(self):
         self.parameters = parameters
         self.defs = defs
@@ -66,7 +70,7 @@ class TestDownload(unittest.TestCase):
 def generator(test_case):
 
     def test_template(self):
-        ie = getattr(youtube_dl.InfoExtractors, test_case['name'] + 'IE')
+        ie = youtube_dl.InfoExtractors.get_info_extractor(test_case['name'])
         if not ie._WORKING:
             print('Skipping: IE marked as not _WORKING')
             return
@@ -102,7 +106,7 @@ def generator(test_case):
                     if retry == RETRIES: raise
 
                     # Check if the exception is not a network related one
-                    if not err.exc_info[0] in (ZeroDivisionError, compat_urllib_error.URLError, socket.timeout):
+                    if not err.exc_info[0] in (compat_urllib_error.URLError, socket.timeout, UnavailableVideoError):
                         raise
 
                     print('Retrying: {0} failed tries\n\n##########\n\n'.format(retry))