Skip to content

Commit

Permalink
Merge pull request #201 from scottclowe/tst-rf_core
Browse files Browse the repository at this point in the history
TST:RF: Move common core test operations into helper methods
  • Loading branch information
scottclowe committed Jun 24, 2021
2 parents 726a4ef + d6ecce2 commit 0a2548b
Show file tree
Hide file tree
Showing 2 changed files with 166 additions and 192 deletions.
4 changes: 3 additions & 1 deletion fissa/tests/base_test.py
Expand Up @@ -30,7 +30,7 @@
def assert_allclose_ragged(actual, desired):
assert_equal(np.shape(actual), np.shape(desired))
for desired_i, actual_i in zip(desired, actual):
if desired.dtype == object:
if np.asarray(desired).dtype == object:
assert_allclose_ragged(actual_i, desired_i)
else:
assert_allclose(actual_i, desired_i)
Expand Down Expand Up @@ -175,6 +175,8 @@ def assert_equal(self, actual, desired, *args, **kwargs):
return assert_equal(actual, desired, *args, **kwargs)

def assert_allclose_ragged(self, actual, desired):
if desired is None:
return self.assertIs(actual, desired)
return assert_allclose_ragged(actual, desired)

def assert_equal_list_of_array_perm_inv(self, actual, desired):
Expand Down

0 comments on commit 0a2548b

Please sign in to comment.