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

Tests error out or fail without additional dependencies #55

Closed
taldcroft opened this issue May 13, 2024 · 1 comment · Fixed by #59
Closed

Tests error out or fail without additional dependencies #55

taldcroft opened this issue May 13, 2024 · 1 comment · Fixed by #59
Assignees
Labels

Comments

@taldcroft
Copy link

Describe the bug

  • Tests do not run without installing h5py.
  • Tests do not pass without installing an additional dependencies.

To Reproduce

$ conda create -n martini python=3.7 
$ conda activate martini
$ pip install pytest
$ pip install -e .
$ pytest
...
============================================== short test summary info ==============================================
ERROR tests/test_martini.py
ERROR tests/test_write.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================= 2 errors in 0.11s =================================================
$ pip install h5py
$ pytest
...
============================================== short test summary info ==============================================
FAILED tests/test_martini.py::TestMartini::test_preview - ModuleNotFoundError: No module named 'matplotlib'
FAILED tests/test_martini.py::TestParallel::test_parallel_consistent_with_serial[True] - ModuleNotFoundError: No module named 'multiprocess'
FAILED tests/test_martini.py::TestParallel::test_parallel_consistent_with_serial[False] - ModuleNotFoundError: No module named 'multiprocess'
FAILED tests/test_martini.py::TestGlobalProfile::test_preview - ModuleNotFoundError: No module named 'matplotlib'
FAILED tests/test_martini.py::TestGlobalProfile::test_view_spectrum - ModuleNotFoundError: No module named 'matplotlib'
FAILED tests/test_sources.py::TestSPHSource::test_preview - ModuleNotFoundError: No module named 'matplotlib'
FAILED tests/test_sources.py::TestSPHSource::test_preview_save[pdf] - ModuleNotFoundError: No module named 'matplotlib'
FAILED tests/test_sources.py::TestSPHSource::test_preview_save[png] - ModuleNotFoundError: No module named 'matplotlib'
FAILED tests/test_spectral_models.py::TestParallelSpectra::test_parallel_spectra[GaussianSpectrum] - ModuleNotFoundError: No module named 'multiprocess'
FAILED tests/test_spectral_models.py::TestParallelSpectra::test_parallel_spectra[DiracDeltaSpectrum] - ModuleNotFoundError: No module named 'multiprocess'
==================================== 10 failed, 887 passed, 7 xfailed in 57.08s =====================================

Expected behaviour

Tests should pass or be skipped if optional dependencies are not installed.

Additional context
Review for pyOpenSci/software-submission#164.

@kyleaoman
Copy link
Owner

Closed by #59

@kyleaoman kyleaoman self-assigned this May 14, 2024
@kyleaoman kyleaoman linked a pull request May 14, 2024 that will close this issue
@kyleaoman kyleaoman added the bug label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants