Skip to content

Commit

Permalink
Update test function args
Browse files Browse the repository at this point in the history
  • Loading branch information
lochhh committed Sep 9, 2024
1 parent 925b17b commit b5f4ca4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/test_unit/test_kinematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,7 @@ def test_approximate_derivative_with_invalid_order(order):
),
],
)
def test_cdist(
self, dim, pairs, expected_data, pairwise_distances_dataset
):
def test_cdist(dim, pairs, expected_data, pairwise_distances_dataset):
"""Test the computation of pairwise distances with known values."""
core_dim = "keypoints" if dim == "individuals" else "individuals"
input_dataarray = pairwise_distances_dataset.position
Expand All @@ -249,7 +247,7 @@ def test_cdist(
expected,
)

def expected_pairwise_distances(self, pairs, input_ds, dim):
def expected_pairwise_distances(pairs, input_ds, dim):
"""Return a list of the expected data variable names
for pairwise distances tests.
"""
Expand Down Expand Up @@ -284,15 +282,15 @@ def expected_pairwise_distances(self, pairs, input_ds, dim):
],
)
def test_compute_pairwise_distances_with_valid_pairs(
self, pairwise_distances_dataset, dim, pairs
pairwise_distances_dataset, dim, pairs
):
"""Test that the expected pairwise distances are computed
for valid ``pairs`` inputs.
"""
result = getattr(kinematics, f"compute_inter{dim[:-1]}_distances")(
pairwise_distances_dataset.position, pairs=pairs
)
expected_data_vars = self.expected_pairwise_distances(
expected_data_vars = expected_pairwise_distances(
pairs, pairwise_distances_dataset, dim
)
if isinstance(result, dict):
Expand All @@ -301,7 +299,7 @@ def test_compute_pairwise_distances_with_valid_pairs(
assert isinstance(result, xr.DataArray)

def test_compute_pairwise_distances_with_invalid_dim(
self, pairwise_distances_dataset
pairwise_distances_dataset,
):
"""Test that an error is raised when an invalid dimension is passed."""
with pytest.raises(ValueError):
Expand Down

0 comments on commit b5f4ca4

Please sign in to comment.