[test] Fixes for old Pythons

This commit is contained in:
dirkf
2023-07-13 20:14:50 +01:00
parent 1634b1d61e
commit 1d8d5a93f7
6 changed files with 30 additions and 15 deletions

View File

@ -9,6 +9,7 @@ import re
import types
import ssl
import sys
import unittest
import youtube_dl.extractor
from youtube_dl import YoutubeDL
@ -17,6 +18,7 @@ from youtube_dl.compat import (
compat_str,
)
from youtube_dl.utils import (
IDENTITY,
preferredencoding,
write_string,
)
@ -298,3 +300,7 @@ def http_server_port(httpd):
else:
sock = httpd.socket
return sock.getsockname()[1]
def expectedFailureIf(cond):
return unittest.expectedFailure if cond else IDENTITY