Skip tests that use unavailable codecs #362
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In openSUSE, the official ffmpeg package doesn't support aac audio and some other codecs due
to legal reasons. There are ffmpeg packages available that support all codecs, but when building the official pydub packages, the official ffmpeg package is used, and so, when running tests, some of these fail because the files format_test.m4a, creative_common.mp4 and wrong_extension.aac can't be read since they use aac audio.
This commit adds two functions get_supported_decoders and get_supported_encoders that return a set with the decoders/encoders that are supported. Then it also adds some decorators to some tests to skip the tests that use unsupported codecs.
Note that functools.lru_cache was added in python 3.3, so it can't be used and that's the reason I added a small implementation of a cache decorator so we don't have to execute ffmpeg for every call to get the supported codecs.