]> jfr.im git - yt-dlp.git/blobdiff - test/test_socks.py
[cleanup] Point all shebang to `python3` (#372)
[yt-dlp.git] / test / test_socks.py
index d07003cebe0b2adca1dccde5c246e44fff270f7b..76aabb27f0bd6aa3c0f3ce05dee409773959c4de 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # coding: utf-8
 from __future__ import unicode_literals
 
@@ -15,7 +15,7 @@
     FakeYDL,
     get_params,
 )
-from youtube_dl.compat import (
+from yt_dlp.compat import (
     compat_str,
     compat_urllib_request,
 )
@@ -77,17 +77,28 @@ def test_secondary_proxy_https(self):
 
 
 class TestSocks(unittest.TestCase):
+    _SKIP_SOCKS_TEST = True
+
     def setUp(self):
+        if self._SKIP_SOCKS_TEST:
+            return
+
         self.port = random.randint(20000, 30000)
         self.server_process = subprocess.Popen([
             'srelay', '-f', '-i', '127.0.0.1:%d' % self.port],
             stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 
     def tearDown(self):
+        if self._SKIP_SOCKS_TEST:
+            return
+
         self.server_process.terminate()
         self.server_process.communicate()
 
     def _get_ip(self, protocol):
+        if self._SKIP_SOCKS_TEST:
+            return '127.0.0.1'
+
         ydl = FakeYDL({
             'proxy': '%s://127.0.0.1:%d' % (protocol, self.port),
         })