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

Run test suite without ffmpeg dependencies #25

Open
ericpre opened this issue Jan 3, 2025 · 0 comments
Open

Run test suite without ffmpeg dependencies #25

ericpre opened this issue Jan 3, 2025 · 0 comments

Comments

@ericpre
Copy link

ericpre commented Jan 3, 2025

Since ffmpeg seems to be an optional dependency (?), the test suite should be run without failure when ffmpeg is not installed.

From https://github.com/hyperspy/hyperspy-extensions-list/actions/runs/12596586494/job/35107968824?pr=64

============================= test session starts ==============================
platform linux -- Python 3.12.8, pytest-8.3.4, pluggy-1.5.0
Matplotlib: 3.10.0
Freetype: 2.[12](https://github.com/hyperspy/hyperspy-extensions-list/actions/runs/12596586494/job/35107968824?pr=64#step:29:13).1
rootdir: /home/runner/work/hyperspy-extensions-list/hyperspy-extensions-list
plugins: mpl-0.17.0, rerunfailures-[15](https://github.com/hyperspy/hyperspy-extensions-list/actions/runs/12596586494/job/35107968824?pr=64#step:29:16).0, xdist-3.6.1
created: 2/2 workers
2 workers [262 items]

..........FFF.........................ss................................ [ 27%]
....................................................................ssss [ 54%]
ssssssss................................................................ [ 82%]
.s............................................                           [100%]
=================================== FAILURES ===================================
____________________ TestCommonStack.test_save_movie[axis0] ____________________
[gw1] linux -- Python 3.12.8 /home/runner/miniconda3/envs/test/bin/python

self = <etspy.tests.test_base.TestCommonStack object at 0x7f2beb99b6e0>
tmp_path = PosixPath('/tmp/pytest-of-runner/pytest-4/popen-gw1/test_save_movie_axis0_0')
axis = ('XY', 77)

    @pytest.mark.parametrize("axis", [("XY", 77), ("XZ", 256), ("YZ", 256)])
    def test_save_movie(self, tmp_path, axis):
        s = ds.get_needle_data(aligned=True)
        f = tmp_path / f"output_movie_{axis[0]}.avi"
>       s.save_movie(start=0, stop=axis[1], outfile=f, axis=axis[0])

../../../miniconda3/envs/test/lib/python3.12/site-packages/etspy/tests/test_base.py:88: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../../miniconda3/envs/test/lib/python3.12/site-packages/etspy/base.py:524: in save_movie
    writer = animation.writers["ffmpeg"](fps=fps)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <matplotlib.animation.MovieWriterRegistry object at 0x7f2bebb3f1a0>
name = 'ffmpeg'

    def __getitem__(self, name):
        """Get an available writer class from its name."""
        if self.is_available(name):
            return self._registered[name]
    writer = animation.writers["ffmpeg"](fps=fps)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <matplotlib.animation.MovieWriterRegistry object at 0x7f2bebb3f1a0>
name = 'ffmpeg'

    def __getitem__(self, name):
        """Get an available writer class from its name."""
        if self.is_available(name):
            return self._registered[name]
>       raise RuntimeError(f"Requested MovieWriter ({name}) not available")
E       RuntimeError: Requested MovieWriter (ffmpeg) not available

../../../miniconda3/envs/test/lib/python3.12/site-packages/matplotlib/animation.py:1[21](https://github.com/hyperspy/hyperspy-extensions-list/actions/runs/12596586494/job/35107968824?pr=64#step:29:22): RuntimeError
=============================== warnings summary ===============================
../../../miniconda3/envs/test/lib/python3.12/site-packages/traits/observation/_generated_parser.py:258
../../../miniconda3/envs/test/lib/python3.12/site-packages/traits/observation/_generated_parser.py:258
  /home/runner/miniconda3/envs/test/lib/python3.12/site-packages/traits/observation/_generated_parser.py:258: DeprecationWarning: module 'sre_parse' is deprecated
    import sre_parse

../../../miniconda3/envs/test/lib/python3.12/site-packages/traits/observation/_generated_parser.py:259
../../../miniconda3/envs/test/lib/python3.12/site-packages/traits/observation/_generated_parser.py:259
  /home/runner/miniconda3/envs/test/lib/python3.12/site-packages/traits/observation/_generated_parser.py:259: DeprecationWarning: module 'sre_constants' is deprecated
    import sre_constants

tests/test_base.py::TestCommonStack::test_save_movie[axis1]
tests/test_base.py::TestCommonStack::test_save_movie[axis2]
tests/test_base.py::TestCommonStack::test_save_movie_invalid_axis
  /home/runner/miniconda3/envs/test/lib/python3.12/site-packages/matplotlib/animation.py:908: UserWarning: Animation was deleted without rendering anything. This is most likely not intended. To prevent deletion, assign the Animation to a variable, e.g. `anim`, that exists until you output the Animation using `plt.show()` or `anim.save()`.
    warnings.warn(

tests/test_utils.py::TestMultiframeAverage::test_register_serialem_stack_multicpu
tests/test_utils.py::TestMultiframeAverage::test_register_serialem_stack_multicpu
  /home/runner/miniconda3/envs/test/lib/python3.12/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=5035) is multi-threaded, use of fork() may lead to deadlocks in the child.
    self.pid = os.fork()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_base.py::TestCommonStack::test_save_movie[axis0] - RuntimeError: Requested MovieWriter (ffmpeg) not available
FAILED tests/test_base.py::TestCommonStack::test_save_movie[axis1] - RuntimeError: Requested MovieWriter (ffmpeg) not available
FAILED tests/test_base.py::TestCommonStack::test_save_movie[axis2] - RuntimeError: Requested MovieWriter (ffmpeg) not available
============ 3 failed, [24](https://github.com/hyperspy/hyperspy-extensions-list/actions/runs/12596586494/job/35107968824?pr=64#step:29:25)4 passed, 15 skipped, 9 warnings in 55.00s ============
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant