From 4d0dff8545cba2a59bd3bda4d3de8e3224401270 Mon Sep 17 00:00:00 2001 From: Kay B <> Date: Sun, 3 Sep 2017 20:52:50 +0200 Subject: [PATCH 1/7] [Readme] Further specify how to run single tests --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6f5d00df3..12b409b4c 100644 --- a/README.md +++ b/README.md @@ -936,6 +936,8 @@ To run the test, simply invoke your favorite test runner, or execute a test file python test/test_download.py nosetests +To see how to run only specific test cases, see [below](#adding-support-for-a-new-site). + If you want to create a build of youtube-dl yourself, you'll need * python @@ -1003,7 +1005,7 @@ After you have ensured this site is distributing its content legally, you can fo } ``` 5. Add an import in [`youtube_dl/extractor/extractors.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/extractors.py). -6. Run `python test/test_download.py TestDownload.test_YourExtractor`. This *should fail* at first, but you can continually re-run it until you're done. If you decide to add more than one test, then rename ``_TEST`` to ``_TESTS`` and make it into a list of dictionaries. The tests will then be named `TestDownload.test_YourExtractor`, `TestDownload.test_YourExtractor_1`, `TestDownload.test_YourExtractor_2`, etc. +6. Run `python test/test_download.py TestDownload.test_YourExtractor`. This *should fail* at first, but you can continually re-run it until you're done. If you decide to add more than one test, then rename ``_TEST`` to ``_TESTS`` and make it into a list of dictionaries. The tests will then be named `TestDownload.test_YourExtractor`, `TestDownload.test_YourExtractor_1`, `TestDownload.test_YourExtractor_2`, etc. Please note, that tests marked with `only_matching` in the code are not counted in. 7. Have a look at [`youtube_dl/extractor/common.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py) for possible helper methods and a [detailed description of what your extractor should and may return](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py#L74-L252). Add tests and code for as many as you want. 8. Make sure your code follows [youtube-dl coding conventions](#youtube-dl-coding-conventions) and check the code with [flake8](https://pypi.python.org/pypi/flake8). Also make sure your code works under all [Python](https://www.python.org/) versions claimed supported by youtube-dl, namely 2.6, 2.7, and 3.2+. 9. When the tests pass, [add](https://git-scm.com/docs/git-add) the new files and [commit](https://git-scm.com/docs/git-commit) them and [push](https://git-scm.com/docs/git-push) the result, like this: From d8ef25999a024d8d703815a9197a00805a30194d Mon Sep 17 00:00:00 2001 From: Kay B <> Date: Tue, 5 Sep 2017 22:19:09 +0200 Subject: [PATCH 2/7] [Readme] Improve PR #14110 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 12b409b4c..d86dd56b6 100644 --- a/README.md +++ b/README.md @@ -936,7 +936,7 @@ To run the test, simply invoke your favorite test runner, or execute a test file python test/test_download.py nosetests -To see how to run only specific test cases, see [below](#adding-support-for-a-new-site). +To see an example of how to run specific test cases, see subitem 5 in #adding-support-for-a-new-site. If you want to create a build of youtube-dl yourself, you'll need From 4cf1607b47b473c0d5df23718e3bf12610f32445 Mon Sep 17 00:00:00 2001 From: Kay B <> Date: Tue, 5 Sep 2017 22:21:16 +0200 Subject: [PATCH 3/7] [Readme] Try to fix markup, PR #14110 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d86dd56b6..cf0df30d2 100644 --- a/README.md +++ b/README.md @@ -936,7 +936,7 @@ To run the test, simply invoke your favorite test runner, or execute a test file python test/test_download.py nosetests -To see an example of how to run specific test cases, see subitem 5 in #adding-support-for-a-new-site. +To see an example of how to run specific test cases, see subitem 5 in (#adding-support-for-a-new-site). If you want to create a build of youtube-dl yourself, you'll need From 1cd4003d78f57d976dff0e717d831c2768587b16 Mon Sep 17 00:00:00 2001 From: Kay B <> Date: Tue, 5 Sep 2017 22:24:08 +0200 Subject: [PATCH 4/7] [Readme] Try to fix markup, PR #14110, round two --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cf0df30d2..7aeeea3b5 100644 --- a/README.md +++ b/README.md @@ -936,7 +936,7 @@ To run the test, simply invoke your favorite test runner, or execute a test file python test/test_download.py nosetests -To see an example of how to run specific test cases, see subitem 5 in (#adding-support-for-a-new-site). +To see an example of how to run specific test cases, see subitem 5 in the instructions on [adding support for a new site](#adding-support-for-a-new-site). If you want to create a build of youtube-dl yourself, you'll need From 079f67204f0c755f3bd98c6038ce426987edb43b Mon Sep 17 00:00:00 2001 From: Kay B <> Date: Tue, 5 Sep 2017 22:25:36 +0200 Subject: [PATCH 5/7] [Readme] Fix typo 5->6, PR #14110 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7aeeea3b5..25f20b2df 100644 --- a/README.md +++ b/README.md @@ -936,7 +936,7 @@ To run the test, simply invoke your favorite test runner, or execute a test file python test/test_download.py nosetests -To see an example of how to run specific test cases, see subitem 5 in the instructions on [adding support for a new site](#adding-support-for-a-new-site). +To see an example of how to run specific test cases, see subitem 6 in the instructions on [adding support for a new site](#adding-support-for-a-new-site). If you want to create a build of youtube-dl yourself, you'll need From 172bcab43c1c9a620ad098badba66a2b9e368745 Mon Sep 17 00:00:00 2001 From: Sergey M Date: Fri, 8 Sep 2017 22:06:59 +0700 Subject: [PATCH 6/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25f20b2df..3f032457f 100644 --- a/README.md +++ b/README.md @@ -936,7 +936,7 @@ To run the test, simply invoke your favorite test runner, or execute a test file python test/test_download.py nosetests -To see an example of how to run specific test cases, see subitem 6 in the instructions on [adding support for a new site](#adding-support-for-a-new-site). +See item 6 of [new extractor tutorial](#adding-support-for-a-new-site) for how to run extractor specific test cases. If you want to create a build of youtube-dl yourself, you'll need From cbcf7e16187d656faa674ea0f61366dc096f4198 Mon Sep 17 00:00:00 2001 From: Sergey M Date: Fri, 8 Sep 2017 22:12:18 +0700 Subject: [PATCH 7/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3f032457f..28ee63f40 100644 --- a/README.md +++ b/README.md @@ -1005,7 +1005,7 @@ After you have ensured this site is distributing its content legally, you can fo } ``` 5. Add an import in [`youtube_dl/extractor/extractors.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/extractors.py). -6. Run `python test/test_download.py TestDownload.test_YourExtractor`. This *should fail* at first, but you can continually re-run it until you're done. If you decide to add more than one test, then rename ``_TEST`` to ``_TESTS`` and make it into a list of dictionaries. The tests will then be named `TestDownload.test_YourExtractor`, `TestDownload.test_YourExtractor_1`, `TestDownload.test_YourExtractor_2`, etc. Please note, that tests marked with `only_matching` in the code are not counted in. +6. Run `python test/test_download.py TestDownload.test_YourExtractor`. This *should fail* at first, but you can continually re-run it until you're done. If you decide to add more than one test, then rename ``_TEST`` to ``_TESTS`` and make it into a list of dictionaries. The tests will then be named `TestDownload.test_YourExtractor`, `TestDownload.test_YourExtractor_1`, `TestDownload.test_YourExtractor_2`, etc. Note that tests with `only_matching` key in test's dict are not counted in. 7. Have a look at [`youtube_dl/extractor/common.py`](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py) for possible helper methods and a [detailed description of what your extractor should and may return](https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py#L74-L252). Add tests and code for as many as you want. 8. Make sure your code follows [youtube-dl coding conventions](#youtube-dl-coding-conventions) and check the code with [flake8](https://pypi.python.org/pypi/flake8). Also make sure your code works under all [Python](https://www.python.org/) versions claimed supported by youtube-dl, namely 2.6, 2.7, and 3.2+. 9. When the tests pass, [add](https://git-scm.com/docs/git-add) the new files and [commit](https://git-scm.com/docs/git-commit) them and [push](https://git-scm.com/docs/git-push) the result, like this: