diff --git a/src/numpydantic/interface/interface.py b/src/numpydantic/interface/interface.py index 3dfc596..14e1231 100644 --- a/src/numpydantic/interface/interface.py +++ b/src/numpydantic/interface/interface.py @@ -115,7 +115,7 @@ class Interface(ABC, Generic[T]): Convert an array of :attr:`.return_type` to a JSON-compatible format using base python types """ - if not isinstance(array, np.ndarray): + if not isinstance(array, np.ndarray): # pragma: no cover array = np.array(array) return array.tolist() diff --git a/tests/test_interface/test_interface.py b/tests/test_interface/test_interface.py index 337ec93..0efd38d 100644 --- a/tests/test_interface/test_interface.py +++ b/tests/test_interface/test_interface.py @@ -1,3 +1,5 @@ +import pdb + import pytest import numpy as np @@ -47,21 +49,21 @@ def test_interface_match_error(interfaces): """ with pytest.raises(ValueError) as e: Interface.match([1, 2, 3]) - assert "Interface1" in e - assert "Interface2" in e + assert "Interface1" in str(e.value) + assert "Interface2" in str(e.value) with pytest.raises(ValueError) as e: - Interface.match([[1, 2, 3], ["hey"]]) - assert "No matching interfaces" in e + Interface.match(([1, 2, 3], ["hey"])) + assert "No matching interfaces" in str(e.value) with pytest.raises(ValueError) as e: Interface.match_output((1, 2, 3)) - assert "Interface1" in e - assert "Interface2" in e + assert "Interface1" in str(e.value) + assert "Interface2" in str(e.value) with pytest.raises(ValueError) as e: Interface.match_output("hey") - assert "No matching interfaces" in e + assert "No matching interfaces" in str(e.value) def test_interface_enabled(interfaces):