diff --git a/tests/test_unit/test_navigation.py b/tests/test_unit/test_navigation.py index dc7f40eaf..2d84a7076 100644 --- a/tests/test_unit/test_navigation.py +++ b/tests/test_unit/test_navigation.py @@ -36,11 +36,7 @@ def test_compute_head_direction_vector(mock_dataset): are computed from a basic mock dataset. """ # Test that validators work - with pytest.raises( - TypeError, - match="Input data must be an xarray.DataArray, but got .", - ): + with pytest.raises(TypeError): np_array = [ [[[1, 0], [-1, 0], [0, -1]]], [[[0, 1], [0, -1], [1, 0]]], @@ -51,19 +47,13 @@ def test_compute_head_direction_vector(mock_dataset): np_array, "left_ear", "right_ear" ) - with pytest.raises( - ValueError, - match="Input data must contain 'time', 'space', and 'keypoints'" - " as dimensions.", - ): + with pytest.raises(AttributeError): mock_dataset_keypoint = mock_dataset.sel(keypoints="nose", drop=True) navigation.compute_head_direction_vector( mock_dataset_keypoint, "left_ear", "right_ear" ) - with pytest.raises( - ValueError, match="The left and right keypoints may not be identical." - ): + with pytest.raises(ValueError): navigation.compute_head_direction_vector( mock_dataset, "left_ear", "left_ear" ) @@ -72,7 +62,7 @@ def test_compute_head_direction_vector(mock_dataset): head_vector = navigation.compute_head_direction_vector( mock_dataset, "left_ear", "right_ear" ) - known_vectors = np.array([[0, 2], [-2, 0], [0, -2], [2, 0]]) + known_vectors = np.array([[[0, 2]], [[-2, 0]], [[0, -2]], [[2, 0]]]) assert ( isinstance(head_vector, xr.DataArray)