Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test `test_default_format_spec` (`test.test_YoutubeDL.TestFormatSelection`) fails #14856

Closed
ghost opened this issue Nov 26, 2017 · 0 comments
Closed

Comments

@ghost
Copy link

@ghost ghost commented Nov 26, 2017

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2017.11.15. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2017.11.15

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


The test test_default_format_spec in test.test_YoutubeDL.TestFormatSelection) fails:

======================================================================
FAIL: test_default_format_spec (test.test_YoutubeDL.TestFormatSelection)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../youtube-dl-2017.11.15/youtube-dl/test/test_YoutubeDL.py", line 470, in test_default_format_spec
    self.assertEqual(ydl._default_format_spec({}), 'best/bestvideo+bestaudio')
AssertionError: u'bestvideo+bestaudio/best' != u'best/bestvideo+bestaudio'
- bestvideo+bestaudio/best
?                    -----
+ best/bestvideo+bestaudio
? +++++

The failing test subcase is if 'is_live': True is given in the constructor of YoutubeDL.

The reason for the failure is that the function _default_format_spec() (defined in youtube_dl/YoutubeDL.py) uses the info_dict passed as argument to check for is_live. It does not use the self.params dictionary which contains the dictionary passed to the constructor at class creation.

Possible solutions:

  • Either fix the test case by passing the dictionary to the _default_format_spec() function instead of the constructor.
  • Or fix the implementation to respect settings in self.params (as it currently does for outtmpl property).
@dstftw dstftw closed this in d08dcd2 Nov 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
0 participants
You can’t perform that action at this time.