{"action":"created","issue":{"url":"https://api.github.com/repos/ritiek/spotify-downloader/issues/448","repository_url":"https://api.github.com/repos/ritiek/spotify-downloader","labels_url":"https://api.github.com/repos/ritiek/spotify-downloader/issues/448/labels{/name}","comments_url":"https://api.github.com/repos/ritiek/spotify-downloader/issues/448/comments","events_url":"https://api.github.com/repos/ritiek/spotify-downloader/issues/448/events","html_url":"https://github.com/ritiek/spotify-downloader/pull/448","id":392654543,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5ODc3MzY5","number":448,"title":"[WIP] Monkeypatch tests","user":{"login":"ritiek","id":20314742,"node_id":"MDQ6VXNlcjIwMzE0NzQy","avatar_url":"https://avatars1.githubusercontent.com/u/20314742?v=4","gravatar_id":"","url":"https://api.github.com/users/ritiek","html_url":"https://github.com/ritiek","followers_url":"https://api.github.com/users/ritiek/followers","following_url":"https://api.github.com/users/ritiek/following{/other_user}","gists_url":"https://api.github.com/users/ritiek/gists{/gist_id}","starred_url":"https://api.github.com/users/ritiek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritiek/subscriptions","organizations_url":"https://api.github.com/users/ritiek/orgs","repos_url":"https://api.github.com/users/ritiek/repos","events_url":"https://api.github.com/users/ritiek/events{/privacy}","received_events_url":"https://api.github.com/users/ritiek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-12-19T15:32:37Z","updated_at":"2018-12-19T15:49:38Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/ritiek/spotify-downloader/pulls/448","html_url":"https://github.com/ritiek/spotify-downloader/pull/448","diff_url":"https://github.com/ritiek/spotify-downloader/pull/448.diff","patch_url":"https://github.com/ritiek/spotify-downloader/pull/448.patch"},"body":"This PR mainly monkeypatches some of our tests, especially the ones that search on YouTube (these have been failing very frequently).\r\n\r\nChanges:\r\n\r\n- `test_with_metadata.py` now makes tests on this track https://open.spotify.com/track/3SipFlNddvL0XNZRLXvdZD (Janji - Heroes). I've saved the HTML content from this track's YouTube's search results to this [Gist](https://gist.github.com/ritiek/e731338e9810e31c2f00f13c249a45f5). It would fetch the raw content of this gist in the tests `test_with_metadata.{test_youtube_url, test_youtube_title}`. Yipee!!\r\n\r\n- Also monkeypatched `Pafy.download` in our tests, so we don't eat heavy network resources. Instead, this call now either generates 1 sec blank audio (using FFmpeg) or does nothing depending on whether we need to perform further operations (like embedding metadata) on the track.\r\n\r\n- The function `convert.song` now also returns the FFmpeg command which was invoked to conversion.\r\n\r\n- `youtube_tools.generate_m3u` now returns a list of YouTube video URLs it wrote in the `.m3u` file.\r\n\r\n- Some minor grammatical changes in variable and function names.\r\n\r\nHowever, there are a couple of more ideas I have for this PR like skipping FFmpeg tests if the user doesn't have it installed and if anything else interesting comes to me, so let's wait a bit before merging this."},"comment":{"url":"https://api.github.com/repos/ritiek/spotify-downloader/issues/comments/448643100","html_url":"https://github.com/ritiek/spotify-downloader/pull/448#issuecomment-448643100","issue_url":"https://api.github.com/repos/ritiek/spotify-downloader/issues/448","id":448643100,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODY0MzEwMA==","user":{"login":"ritiek","id":20314742,"node_id":"MDQ6VXNlcjIwMzE0NzQy","avatar_url":"https://avatars1.githubusercontent.com/u/20314742?v=4","gravatar_id":"","url":"https://api.github.com/users/ritiek","html_url":"https://github.com/ritiek","followers_url":"https://api.github.com/users/ritiek/followers","following_url":"https://api.github.com/users/ritiek/following{/other_user}","gists_url":"https://api.github.com/users/ritiek/gists{/gist_id}","starred_url":"https://api.github.com/users/ritiek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritiek/subscriptions","organizations_url":"https://api.github.com/users/ritiek/orgs","repos_url":"https://api.github.com/users/ritiek/repos","events_url":"https://api.github.com/users/ritiek/events{/privacy}","received_events_url":"https://api.github.com/users/ritiek/received_events","type":"User","site_admin":false},"created_at":"2018-12-19T15:49:38Z","updated_at":"2018-12-19T15:49:38Z","author_association":"OWNER","body":"Note to self: Fix these warnings showing up on Travis:\r\n```\r\ntest/test_with_metadata.py::test_youtube_url\r\n  /home/travis/build/ritiek/spotify-downloader/spotdl/youtube_tools.py:158: RemovedInPytest4Warning: Fixture \"monkeypatch_youtube_search_page\" called directly. Fixtures are not meant to be called directly, are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/latest/fixture.html for more information.\r\n    url = url_fetch.scrape()\r\ntest/test_with_metadata.py::test_youtube_title\r\n  /home/travis/build/ritiek/spotify-downloader/spotdl/youtube_tools.py:158: RemovedInPytest4Warning: Fixture \"monkeypatch_youtube_search_page\" called directly. Fixtures are not meant to be called directly, are created automatically when test functions request them as parameters. See https://docs.pytest.org/en/latest/fixture.html for more information.\r\n    url = url_fetch.scrape()\r\n```"}}
{"actor":{"display_login":"ritiek"}}