astropy: quantity_allclose can not be imported without pytest installed
>>> from astropy.tests.helper import quantity_allclose
File "/opt/miniconda/envs/clean/lib/python3.6/site-packages/astropy/tests/helper.py", line 14, in <module>
import pytest
ModuleNotFoundError: No module named 'pytest'
Is this a recent change? I feel these “all close” helpers should be somewhere else? I am happy to PR this if people agree.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 17 (17 by maintainers)
Commits related to this issue
- Merge pull request #7252 from rohanrajpal/bugfix-for-issue-7235 Moving function quantity_allclose #7235 — committed to astropy/astropy by pllim 6 years ago
- Merge pull request #7252 from rohanrajpal/bugfix-for-issue-7235 Moving function quantity_allclose #7235 — committed to astropy/astropy by pllim 6 years ago
- Merge pull request #7252 from rohanrajpal/bugfix-for-issue-7235 Moving function quantity_allclose #7235 — committed to astropy/astropy by pllim 6 years ago
quantity_allcloseshould actually be moved tounits(notutils) if you want to move it anywhere.Although, I wonder we should leave a
assert_quantity_allclosein the test helper, to be analogous withnumpy.testing. 🤔Try 3.0.2 or later.
@pllim i did deprecate the function but the
import pytestcommand is still there and still gives the errorI tried finding the pytest file and it seems be somewhere else ,not in the same folder as helper.py
@mhvk I have successfully moved the
quantity_allcloseto quantity.py and the commandastropy.units.quantity import quantity_allclosepasses without any errors or warnings@rohanrajpal - If it’s related to this issues, it’s best to keep it in here. If it’s related on setting up the developer environment, etc, you may want to ask on the slack channel or here.
I’ll take this up.This would be my first bug fix, so would take a little more time than usual simple fixes take.