#!/usr/bin/env python3
-from __future__ import unicode_literals
-
+# Allow direct execution
import os
import sys
import unittest
+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-from test.helper import get_params, try_rm, is_download_test
-import yt_dlp.YoutubeDL
+
+from test.helper import get_params, is_download_test, try_rm
+import yt_dlp.YoutubeDL # isort: split
from yt_dlp.utils import DownloadError
class YoutubeDL(yt_dlp.YoutubeDL):
def __init__(self, *args, **kwargs):
- super(YoutubeDL, self).__init__(*args, **kwargs)
+ super().__init__(*args, **kwargs)
self.to_stderr = self.to_screen
def hook_three(self, filename):
self.files.append(filename)
- raise Exception('Test exception for \'%s\'' % filename)
+ raise Exception(f'Test exception for \'{filename}\'')
def tearDown(self):
for f in self.files: