A feature-rich command-line audio/video downloader
Add support for single-test tox runs
Filippo Valsordad3f46b9aa572
diff --git a/test/__init__.py b/test/__init__.pynew file mode 100644index 0000000000..e69de29bb2diff --git a/test/test_age_restriction.py b/test/test_age_restriction.pyindex 943f9a315f..ec3e30572f 100644--- a/test/test_age_restriction.py+++ b/test/test_age_restriction.py@@ -8,7 +8,7 @@ import ossys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))from youtube_dl import YoutubeDL-from helper import try_rm+from .helper import try_rmdef _download_restricted(url, filename, age):diff --git a/test/test_all_urls.py b/test/test_all_urls.pyindex ff1c86efeb..b28ad000bc 100644--- a/test/test_all_urls.py+++ b/test/test_all_urls.py@@ -8,7 +8,7 @@ import ossys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))from youtube_dl.extractor import YoutubeIE, YoutubePlaylistIE, YoutubeChannelIE, JustinTVIE, gen_extractors-from helper import get_testcases+from .helper import get_testcasesclass TestAllURLsMatching(unittest.TestCase):def setUp(self):diff --git a/test/test_dailymotion_subtitles.py b/test/test_dailymotion_subtitles.pyindex ed2ad311df..e655d280de 100644--- a/test/test_dailymotion_subtitles.py+++ b/test/test_dailymotion_subtitles.py@@ -10,7 +10,7 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))from youtube_dl.extractor import DailymotionIEfrom youtube_dl.utils import *-from helper import FakeYDL+from .helper import FakeYDLmd5 = lambda s: hashlib.md5(s.encode('utf-8')).hexdigest()diff --git a/test/test_download.py b/test/test_download.pyindex fdf59bb5c6..68da4d9845 100644--- a/test/test_download.py+++ b/test/test_download.py@@ -37,8 +37,8 @@ def _file_md5(fn):with open(fn, 'rb') as f:return hashlib.md5(f.read()).hexdigest()-import helper # Set up remaining global configuration-from helper import get_testcases, try_rm+import test.helper as helper # Set up remaining global configuration+from .helper import get_testcases, try_rmdefs = get_testcases()with io.open(PARAMETERS_FILE, encoding='utf-8') as pf:diff --git a/test/test_playlists.py b/test/test_playlists.pyindex de8bd298a3..108a4d63bc 100644--- a/test/test_playlists.py+++ b/test/test_playlists.py@@ -20,7 +20,7 @@ from youtube_dl.extractor import ()from youtube_dl.utils import *-from helper import FakeYDL+from .helper import FakeYDLclass TestPlaylists(unittest.TestCase):def assertIsPlaylist(self, info):diff --git a/test/test_youtube_lists.py b/test/test_youtube_lists.pyindex 53e65816df..0b5c790301 100644--- a/test/test_youtube_lists.py+++ b/test/test_youtube_lists.py@@ -11,7 +11,7 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))from youtube_dl.extractor import YoutubeUserIE, YoutubePlaylistIE, YoutubeIE, YoutubeChannelIE, YoutubeShowIEfrom youtube_dl.utils import *-from helper import FakeYDL+from .helper import FakeYDLclass TestYoutubeLists(unittest.TestCase):def assertIsPlaylist(self,info):diff --git a/test/test_youtube_subtitles.py b/test/test_youtube_subtitles.pyindex f9b0c1ad0b..07850385e0 100644--- a/test/test_youtube_subtitles.py+++ b/test/test_youtube_subtitles.py@@ -10,7 +10,7 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))from youtube_dl.extractor import YoutubeIEfrom youtube_dl.utils import *-from helper import FakeYDL+from .helper import FakeYDLmd5 = lambda s: hashlib.md5(s.encode('utf-8')).hexdigest()diff --git a/tox.ini b/tox.iniindex 53b461fdbb..ed01e3386d 100644--- a/tox.ini+++ b/tox.ini@@ -1,5 +1,8 @@[tox]envlist = py26,py27,py33[testenv]-deps = nose-commands = nosetests --with-coverage --cover-package=youtube_dl --cover-html --verbose test+deps =+ nose+ coverage+commands = nosetests --verbose {posargs:test} # --with-coverage --cover-package=youtube_dl --cover-html+ # test.test_download:TestDownload.test_NowVideo