diff --git a/tests/python/conftest.py b/tests/python/conftest.py index 4dab81d5f39a..a77809da6a4f 100644 --- a/tests/python/conftest.py +++ b/tests/python/conftest.py @@ -58,11 +58,11 @@ def has_array(element): if element in seen: return False seen.add(element) - except (TypeError, ValueError): # unhashable + except (TypeError, ValueError, NotImplementedError): # unhashable pass if isinstance(element, mx.nd._internal.NDArrayBase): - return True + return element._alive # We only care about catching NDArray's that haven't been freed in the backend yet elif isinstance(element, mx.sym._internal.SymbolBase): return False elif hasattr(element, '__dict__'):