diff --git a/src/spikeinterface/qualitymetrics/tests/test_quality_metric_calculator.py b/src/spikeinterface/qualitymetrics/tests/test_quality_metric_calculator.py index 56e3975210..71569e7b2b 100644 --- a/src/spikeinterface/qualitymetrics/tests/test_quality_metric_calculator.py +++ b/src/spikeinterface/qualitymetrics/tests/test_quality_metric_calculator.py @@ -136,12 +136,12 @@ def test_empty_units(sorting_analyzer_simple): # num_spikes are ints not nans so we confirm empty units are nans for everything except # num_spikes which should be 0 nan_containing_columns = [column for column in metrics_empty.columns if column != "num_spikes"] - for empty_unit_id in sorting_empty.get_empty_unit_ids(): + for empty_unit_ids in sorting_empty.get_empty_unit_ids(): from pandas import isnull - assert np.all(isnull(metrics_empty.loc[empty_unit_id, nan_containing_columns].values)) + assert np.all(isnull(metrics_empty.loc[empty_unit_ids, nan_containing_columns].values)) if "num_spikes" in metrics_empty.columns: - assert metrics_empty.loc[empty_unit_id, ["num_spikes"]] == 0 + assert sum(metrics_empty.loc[empty_unit_ids, ["num_spikes"]]) == 0 # TODO @alessio all theses old test should be moved in test_metric_functions.py or test_pca_metrics()