[tests] Don't auto init YoutubeDL
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sun, 2 Nov 2014 16:53:12 +0000 (17:53 +0100)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sun, 2 Nov 2014 16:53:12 +0000 (17:53 +0100)
It would print the debug headers for each test.
And nose uses a StringIO object for stdout, which in python 2.x doesn't have the 'encoding' attribute.

test/helper.py
test/test_download.py

index fb8618120dcbbcdcfe6d576442e5bea189cb2521..325f72f0a35c5c4fe6ac3a1464858b200c152aad 100644 (file)
@@ -57,7 +57,7 @@ class FakeYDL(YoutubeDL):
         # Different instances of the downloader can't share the same dictionary
         # some test set the "sublang" parameter, which would break the md5 checks.
         params = get_params(override=override)
-        super(FakeYDL, self).__init__(params)
+        super(FakeYDL, self).__init__(params, auto_init=False)
         self.result = []
         
     def to_screen(self, s, skip_eol=None):
index 88ce29871d87700fa183cf66d918139e83e76fc9..87aced97cfe6e25750183e2fd94d4c2392703d9b 100644 (file)
@@ -96,7 +96,7 @@ def generator(test_case):
             params.setdefault('extract_flat', True)
             params.setdefault('skip_download', True)
 
-        ydl = YoutubeDL(params)
+        ydl = YoutubeDL(params, auto_init=False)
         ydl.add_default_info_extractors()
         finished_hook_called = set()
         def _hook(status):