aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/helper.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <[email protected]>2014-04-19 19:41:06 +0200
committerPhilipp Hagemeister <[email protected]>2014-04-19 19:41:06 +0200
commit52fadd5fb2ea5d7e7cd6000203aa7ef886ffad07 (patch)
tree9c8caae3790b3237cf78c40facaeb4dd20d103ca /test/helper.py
parent5367fe7f4d8699b711a712598615a815a013fa9c (diff)
downloadyoutube-dl-52fadd5fb2ea5d7e7cd6000203aa7ef886ffad07.tar.gz
youtube-dl-52fadd5fb2ea5d7e7cd6000203aa7ef886ffad07.zip
[test_all_urls] Add support for distributed URL matching test definition
Diffstat (limited to 'test/helper.py')
-rw-r--r--test/helper.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/helper.py b/test/helper.py
index 8739f816c..09873aea3 100644
--- a/test/helper.py
+++ b/test/helper.py
@@ -74,13 +74,19 @@ class FakeYDL(YoutubeDL):
old_report_warning(message)
self.report_warning = types.MethodType(report_warning, self)
-def gettestcases():
+
+def gettestcases(include_onlymatching=False):
for ie in youtube_dl.extractor.gen_extractors():
t = getattr(ie, '_TEST', None)
if t:
- t['name'] = type(ie).__name__[:-len('IE')]
- yield t
- for t in getattr(ie, '_TESTS', []):
+ assert not hasattr(ie, '_TESTS'), \
+ '%s has _TEST and _TESTS' % type(ie).__name__
+ tests = [t]
+ else:
+ tests = getattr(ie, '_TESTS', [])
+ for t in tests:
+ if not include_onlymatching and getattr(t, 'only_matching', False):
+ continue
t['name'] = type(ie).__name__[:-len('IE')]
yield t