learningequality / pressurecooker

A library of various media and content processing utilities for use in Ricecooker
MIT License
3 stars 9 forks source link

Test clean-up #37

Closed bjester closed 5 years ago

bjester commented 5 years ago

Description

I was running into issues running the tests. The changes hopefully make it more straightforward.

Eliminated some warnings generated from tests to clean up output:

tests/test_thumbnails.py::Test_wavefile_thumbnail_generation::test_generates_thumbnail
  /home/bjester/Projects/learningequality/pressurecooker/pressurecooker/images.py:89: DeprecationWarning: Numeric-style type codes are deprecated and will result in an error in the future.
    signal = np.frombuffer(signal, 'Int16')

and

tests/test_thumbnails.py::Test_wavefile_thumbnail_generation::test_generates_thumbnail
  /home/bjester/Projects/learningequality/pressurecooker/pressurecooker/images.py:89: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
    signal = np.fromstring(signal, np.int16)

Additionally, the tests in tests/test_youtube.py were failing when run straight with pytest. The tox configuration runs them with -s switch, which is required for them to pass with straight pytest. I updated the tox.ini to add that option, resolving the issue.

ivanistheone commented 5 years ago

Green dot, green dot, green dot:

(venv) ivan@probook ~/P/F/pressurecooker> pytest
platform darwin -- Python 3.7.2, pytest-4.1.0, py-1.7.0, pluggy-0.8.0
collected 25 items
tests/test_converters.py .                                                                                                            [  4%]
tests/test_thumbnails.py .                                                                                                            [  8%]
tests/test_videos.py ...........                                                                                                      [ 52%]
tests/test_web.py ...                                                                                                                 [ 64%]
tests/test_youtube.py .........                                                                                                       [100%]
(venv2) ivan@probook ~/P/F/pressurecooker> pytest
platform darwin -- Python 2.7.10, pytest-4.1.0, py-1.7.0, pluggy-0.8.0
collected 25 items
tests/test_converters.py s                                                                                                            [  4%]
tests/test_thumbnails.py .                                                                                                            [  8%]
tests/test_videos.py ...........                                                                                                      [ 52%]
tests/test_web.py ...                                                                                                                 [ 64%]
tests/test_youtube.py .........                                                                                                       [100%]