Skip to content

Commit fb29bda

Browse files
committed
TST: re-add instance-level array equality check in assert_mixin_columns_equal
1 parent 44b1613 commit fb29bda

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

‎astropy/tests/helper.py‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
import numpy as np
1414
import pytest
1515

16-
from astropy.units import allclose as quantity_allclose # noqa: F401
16+
from astropy.units import allclose as quantity_allclose
1717
from astropy.utils.introspection import minversion
1818

1919
# For backward-compatibility with affiliated packages
2020
from .runner import TestRunner # noqa: F401
2121

2222
if TYPE_CHECKING:
23+
from typing import Any
24+
2325
from astropy.table.typing import MixinColumn
2426

2527
__all__ = [
@@ -215,7 +217,7 @@ def assert_mixin_columns_equal(
215217
*,
216218
attrs: list[str] | None = None,
217219
compare_class: bool = True,
218-
rtol: float =1e-15,
220+
rtol: float = 1e-15,
219221
**kwargs: Any,
220222
) -> None:
221223
"""Compare mixin columns by their shape and attributes, including those provided by .info
@@ -286,3 +288,10 @@ def assert_mixin_columns_equal(
286288
assert np.can_cast(a2, a1, casting="safe")
287289
else:
288290
assert np.all(a1 == a2)
291+
292+
# For no attrs that means we just compare directly.
293+
if not attrs:
294+
if isinstance(actual, np.ndarray) and actual.dtype.kind == "f":
295+
assert quantity_allclose(actual, desired, rtol=1e-15)
296+
else:
297+
assert np.all(actual == desired)

0 commit comments

Comments
 (0)