aboutsummaryrefslogtreecommitdiff
path: root/test/test_download.py
diff options
context:
space:
mode:
authorRandom User <rndusr@posteo.de>2017-03-25 21:36:59 +0100
committerRandom User <rndusr@posteo.de>2017-03-25 21:36:59 +0100
commit4f06c1c9fcbfbc74b81b5fa89a616914b5ce5aad (patch)
treea51b702e001d350b908780a119f76d8ea706d511 /test/test_download.py
parentc73e330e7adc9c0c15ac51aeea8fbb7dad95351a (diff)
parent942b44a0525f677924c660bcb00902d705d91fc2 (diff)
downloadyoutube-dl-4f06c1c9fcbfbc74b81b5fa89a616914b5ce5aad.tar.xz
Merge branch 'master' of github.com-rndusr:rg3/youtube-dl into fix/str-item-assignment
Diffstat (limited to 'test/test_download.py')
-rw-r--r--test/test_download.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_download.py b/test/test_download.py
index 30034f978..01a8bcb89 100644
--- a/test/test_download.py
+++ b/test/test_download.py
@@ -71,6 +71,18 @@ class TestDownload(unittest.TestCase):
maxDiff = None
+ def __str__(self):
+ """Identify each test with the `add_ie` attribute, if available."""
+
+ def strclass(cls):
+ """From 2.7's unittest; 2.6 had _strclass so we can't import it."""
+ return '%s.%s' % (cls.__module__, cls.__name__)
+
+ add_ie = getattr(self, self._testMethodName).add_ie
+ return '%s (%s)%s:' % (self._testMethodName,
+ strclass(self.__class__),
+ ' [%s]' % add_ie if add_ie else '')
+
def setUp(self):
self.defs = defs
@@ -233,6 +245,8 @@ for n, test_case in enumerate(defs):
i += 1
test_method = generator(test_case, tname)
test_method.__name__ = str(tname)
+ ie_list = test_case.get('add_ie')
+ test_method.add_ie = ie_list and ','.join(ie_list)
setattr(TestDownload, test_method.__name__, test_method)
del test_method