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
Running tests from astropy.test() fails when asdf-astropy is installed #16165
Comments
I suspect this is an interaction between |
I can reproduce this issue with a clean build. As yes it does seem like the this is something to do with the important machinery of how asdf is imported. As To test this just turning off the --- a/astropy/table/__init__.py
+++ b/astropy/table/__init__.py
@@ -123,5 +123,5 @@ with registry.delay_doc_updates(Table):
from .jsviewer import JSViewer
- if optional_deps.HAS_ASDF_ASTROPY:
- import asdf_astropy.io.connect
+ #if optional_deps.HAS_ASDF_ASTROPY:
+ # import asdf_astropy.io.connect Maybe this issue just means it's time to relook #16152 and if it's worth the maintenance overhead to maintain a pytest wrapper inside astropy. |
@WilliamJamieson , do we still need the commented Thanks for investigating, @MridulS ! |
I believe we do because that is what enables astropy tables to be backed by ASDF flies. |
This was for backward compatibility, right? I wonder if we can get away by removing it for v7.0 now that astropy/astropy/table/__init__.py Lines 126 to 127 in d32a06a
Other packages like |
For now, the best low-impact idea I have is to create a "Known Issue" entry to ask people to uninstall |
If the long-term plan is to keep +1 on adding this to the docs as a known issue! And thank you for raising this issue! |
I wonder if |
In Debian, we use pytest only (specifically |
Would a known issue entry like this help? |
On Python 3.12.2 if I install
astropy
in a clean environment using an editable install with thetest
andall
dependencies included and then runThe tests fail to run with the error during test collection:
However, when I invoke
pytest
from the CLI using eitherpytest
(in the astropy repo root directory) orpytest --pyargs astropy
, the tests run and pass without issue.I suspect this has to do with some interaction between
asdf
andastropy
during the test collection process. For example the issue disappears if I manually uninstallasdf-astropy
as this turns off all theasdf
related tests in astropy, which only consist of the doctests here:astropy/docs/modeling/models.rst
Lines 945 to 969 in d32a06a
As in this case the doctests will be skipped if
asdf-astropy
is not installed.This was run on an M3 Mac using Python 3.12 with installed packages:
The text was updated successfully, but these errors were encountered: