diff options
author | Filippo Valsorda <filippo.valsorda@gmail.com> | 2012-12-08 01:57:43 +0100 |
---|---|---|
committer | Filippo Valsorda <filippo.valsorda@gmail.com> | 2012-12-08 01:57:43 +0100 |
commit | 3c6ffbaedbbae8734f6b86fea1169413b656abf3 (patch) | |
tree | 27edbd964e1411e0228900b1c36612058cca7954 /test/gentests.py | |
parent | c7287a3cafba65b700b64633d76aa016f5cbc95d (diff) | |
parent | 863baa16eca7a98c38fb29c5e54f76df224f2351 (diff) |
Merge 'rg3/master' into fork_master
Diffstat (limited to 'test/gentests.py')
-rwxr-xr-x | test/gentests.py | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/test/gentests.py b/test/gentests.py index c3cca5156..9352d6d94 100755 --- a/test/gentests.py +++ b/test/gentests.py @@ -34,31 +34,19 @@ import youtube_dl.InfoExtractors def _file_md5(fn): with open(fn, 'rb') as f: return hashlib.md5(f.read()).hexdigest() - -def md5_for_file(filename, block_size=2**20): - with open(filename) as f: - md5 = hashlib.md5() - while True: - data = f.read(block_size) - if not data: - break - md5.update(data) - return md5.hexdigest() -_file_md5 = md5_for_file - - try: _skip_unless = unittest.skipUnless 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) |