From 9353ef9f681f032feee777fabbb8db8ae98aa79d Mon Sep 17 00:00:00 2001 From: Liam Connors Date: Wed, 18 Sep 2024 02:44:04 -0400 Subject: [PATCH] test: convert cuDF numpy types to python types in tests (#987) * convert cuDF scalars to python types * add pragma: no cover to tests --- tests/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/utils.py b/tests/utils.py index b13bec192..e8b453f9d 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -39,6 +39,10 @@ def compare_dicts(result: Any, expected: dict[str, Any]) -> None: lhs = lhs.as_py() # noqa: PLW2901 if hasattr(rhs, "as_py"): # pragma: no cover rhs = rhs.as_py() # noqa: PLW2901 + if hasattr(lhs, "item"): # pragma: no cover + lhs = lhs.item() # noqa: PLW2901 + if hasattr(rhs, "item"): # pragma: no cover + rhs = rhs.item() # noqa: PLW2901 if isinstance(lhs, float) and not math.isnan(lhs): assert math.isclose(lhs, rhs, rel_tol=0, abs_tol=1e-6), (lhs, rhs) elif isinstance(lhs, float) and math.isnan(lhs):