mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 14:14:54 +01:00
Fix 2.6 nosetests
This commit is contained in:
parent
743b28ce11
commit
8af4ed7b4f
|
@ -52,13 +52,14 @@ def md5_for_file(filename, block_size=2**20):
|
|||
except AttributeError: # Python 2.6
|
||||
def _skip_unless(cond, reason='No reason given'):
|
||||
def resfunc(f):
|
||||
def wfunc(*args, **kwargs):
|
||||
# Start the function name with test to appease nosetests-2.6
|
||||
def test_wfunc(*args, **kwargs):
|
||||
if cond:
|
||||
return f(*args, **kwargs)
|
||||
else:
|
||||
print('Skipped test')
|
||||
return
|
||||
return wfunc
|
||||
return test_wfunc
|
||||
return resfunc
|
||||
_skip = lambda *args, **kwargs: _skip_unless(False, *args, **kwargs)
|
||||
|
||||
|
|
|
@ -38,13 +38,14 @@ def md5_for_file(filename, block_size=2**20):
|
|||
except AttributeError: # Python 2.6
|
||||
def _skip_unless(cond, reason='No reason given'):
|
||||
def resfunc(f):
|
||||
def wfunc(*args, **kwargs):
|
||||
# Start the function name with test to appease nosetests-2.6
|
||||
def test_wfunc(*args, **kwargs):
|
||||
if cond:
|
||||
return f(*args, **kwargs)
|
||||
else:
|
||||
print('Skipped test')
|
||||
return
|
||||
return wfunc
|
||||
return test_wfunc
|
||||
return resfunc
|
||||
_skip = lambda *args, **kwargs: _skip_unless(False, *args, **kwargs)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user