mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-08-18 10:06:20 +03:00
[cleanup] Misc (#16697)
Authored by: Grub4K, bashonly Co-authored-by: bashonly <bashonly@protonmail.com>
This commit is contained in:
co-authored by
bashonly
parent
25056f0d2d
commit
821bef0f00
@@ -6,11 +6,11 @@ import sys
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
|
||||
from yt_dlp.globals import all_plugins_loaded
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
|
||||
from yt_dlp.globals import all_plugins_loaded
|
||||
|
||||
import contextlib
|
||||
import copy
|
||||
import json
|
||||
|
||||
@@ -102,6 +102,7 @@ class HTTPTestHandler(http.server.BaseHTTPRequestHandler):
|
||||
self.end_headers()
|
||||
self.wfile.write(json.dumps(list(self.headers.items())).encode())
|
||||
|
||||
|
||||
class HTTPTestServer(http.server.HTTPServer):
|
||||
@property
|
||||
def address(self, /):
|
||||
|
||||
@@ -20,7 +20,12 @@ LAZY_EXTRACTORS = 'yt_dlp/extractor/lazy_extractors.py'
|
||||
class TestExecution(unittest.TestCase):
|
||||
def run_yt_dlp(self, exe=(sys.executable, 'yt_dlp/__main__.py'), opts=('--version', )):
|
||||
stdout, stderr, returncode = Popen.run(
|
||||
[*exe, '--ignore-config', *opts], cwd=rootDir, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
[*exe, '--no-update', '--ignore-config', *opts],
|
||||
cwd=rootDir,
|
||||
text=True,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
)
|
||||
print(stderr, file=sys.stderr)
|
||||
self.assertEqual(returncode, 0)
|
||||
return stdout.strip(), stderr.strip()
|
||||
|
||||
Reference in New Issue
Block a user