Skip to content

Commit

Permalink
distinguish datatypes in test assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrofelder committed Apr 29, 2024
1 parent 69988fa commit 8b8d6e1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/tests/test_unit/test_regions/test_region_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ def test_summarise_brain_regions_all_not_empty(
df = pd.read_csv(filename)
assert df.shape == (3, 11)
for key, value in previous_world_space_values.items():
assert np.isclose(df[key].iloc[0],value)
if isinstance(value, (int, float)):
assert np.isclose(df[key].iloc[0], value)
else:
assert df[key].iloc[0] == value


def test_summarise_brain_regions_some_empty(
Expand All @@ -124,8 +127,10 @@ def test_summarise_brain_regions_some_empty(
df = pd.read_csv(filename)
assert df.shape == (1, 11)
for key, value in previous_world_space_values.items():
assert np.isclose(df[key].iloc[0], value)

if isinstance(value, (int, float)):
assert np.isclose(df[key].iloc[0], value)
else:
assert df[key].iloc[0] == value

def test_summarise_brain_regions_all_empty(
labels_layer, empty_labels_layer, tmp_path
Expand Down

0 comments on commit 8b8d6e1

Please sign in to comment.