瀏覽代碼

[tests] Don't auto init YoutubeDL

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.
Jaime Marquínez Ferrándiz 10 年之前
父節點
當前提交
ac35c26686
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      test/helper.py
  2. 1 1
      test/test_download.py

+ 1 - 1
test/helper.py

@@ -57,7 +57,7 @@ class FakeYDL(YoutubeDL):
         # Different instances of the downloader can't share the same dictionary
         # Different instances of the downloader can't share the same dictionary
         # some test set the "sublang" parameter, which would break the md5 checks.
         # some test set the "sublang" parameter, which would break the md5 checks.
         params = get_params(override=override)
         params = get_params(override=override)
-        super(FakeYDL, self).__init__(params)
+        super(FakeYDL, self).__init__(params, auto_init=False)
         self.result = []
         self.result = []
         
         
     def to_screen(self, s, skip_eol=None):
     def to_screen(self, s, skip_eol=None):

+ 1 - 1
test/test_download.py

@@ -96,7 +96,7 @@ def generator(test_case):
             params.setdefault('extract_flat', True)
             params.setdefault('extract_flat', True)
             params.setdefault('skip_download', True)
             params.setdefault('skip_download', True)
 
 
-        ydl = YoutubeDL(params)
+        ydl = YoutubeDL(params, auto_init=False)
         ydl.add_default_info_extractors()
         ydl.add_default_info_extractors()
         finished_hook_called = set()
         finished_hook_called = set()
         def _hook(status):
         def _hook(status):