Repository navigation
Description
As I mentioned in #17732 (review), I'm currently seeing 12 tests consistently fail when running double tests locally1
❯ pytest --color=no --keep-duplicates --pyargs astropy astropy > double_test.log 2>&1
...
=========================== short test summary info ============================
FAILED astropy/modeling/tests/test_input.py::test_call_keyword_args_1[model0]
FAILED astropy/modeling/tests/test_input.py::test_call_keyword_args_1[model1]
FAILED astropy/modeling/tests/test_input.py::test_call_keyword_args_1[model2]
FAILED astropy/modeling/tests/test_input.py::test_call_keyword_args_1[model3]
FAILED astropy/modeling/tests/test_input.py::test_call_keyword_args_1[model4]
FAILED astropy/modeling/tests/test_input.py::test_call_keyword_args_2[model0]
FAILED astropy/modeling/tests/test_input.py::test_call_keyword_args_2[model1]
FAILED astropy/modeling/tests/test_input.py::test_call_keyword_args_2[model2]
FAILED astropy/units/tests/test_quantity_ufuncs.py::TestUfuncHelpers::test_scipy_registered
FAILED astropy/units/tests/test_quantity_ufuncs.py::test_scipy_registration
FAILED astropy/visualization/wcsaxes/tests/test_wcsapi.py::test_coord_type_from_ctype
FAILED astropy/visualization/wcsaxes/tests/test_wcsapi.py::test_custom_coord_type_1d_2d_wcs_overwrite
==== 12 failed, 57587 passed, 752 skipped, 446 xfailed in 302.79s (0:05:02) ====
I checked that this reproduced even from a fresh clone + fresh env (resolved via uv pip install -e [test_all]), so I'm confident it's not a side effect of my own copy being dirty. For reference it fails the same way with numpy 1.26 or numpy 2.
I also tried running the same invocation with v6.1.x2 (branch) and saw no failures there.
However v7.0.0 (tag) shows3 the same 12 failures.
I intend to try out https://pypi.org/project/detect-test-pollution/ to narrow it down and will report back when I know more about this issue.
Footnotes
-
this was already the case with the previous invocation,
python -c 'import sys; from astropy import test; test(); sys.exit(test())', so TST: Do not use astropy.test() in double run #17732 is not the culprit. ↩ -
specifically with Python 3.12 +
numpy<2, otherwise some ofunitscompleteness test don't pass, which is basically noise in this context ↩ -
specifically with Python 3.13 +
numpy<2.2, for the same reason as 2. ↩
Activity
neutrinoceros commentedon Feb 8, 2025
Phew,
detect-test-pollutionactually returned something in under 7min, which is much faster than I anticipated:I'll see about that after lunch ! In the mean time, I'll keep my computer busy by running a git bisection between 6.1.x and 7.0.0 to collect more clues.
neutrinoceros commentedon Feb 8, 2025
Nevermind, I actually can reproduce on 6.1.x as well. According to the logs, my first attempt didn't include every optional deps like
scipyormatplotlibso maybe that's why. Since each iteration takes several minutes, and I don't actually know of a "good" commit, let's give up on bisection for now.What's extremely puzzling still is that double tests has been running fine on CI all this time, though it may be a platform specific thing (I'm on macOS)
Other results
neutrinoceros commentedon Feb 10, 2025
Oops, this was accidentally linked to #17747 where @mhvk said it does "not fix #17745"
neutrinoceros commentedon Feb 10, 2025
regarding tests about scipy-registration:
while it's pretty clear why these tests create pollution, why they fail on a second run (it is pretty evident in
astropy/astropy/units/tests/test_quantity_ufuncs.py
Line 1565 in 38faeb3
ref #7636
@mhvk, any ideas ?
neutrinoceros commentedon Feb 10, 2025
Actually I have an idea for a minimal patch, stay tuned.
update: this is #17750
neutrinoceros commentedon Feb 10, 2025
All reported problems should be addressed within
custom_ucd_coord_meta_mappingcontext manager performs a (correct) cleanup #17749astropy.units#17750astropy.modeling#17752None of the above will close the present issue mind you. Once they are all in, I'll open one last PR to add scipy to double tests jobs, to avoid regressions there.
[-]TST: test pollution seen locally in double test runs[/-][+]TST: test pollution in scipy-only tests[/+]