Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed four test issues within test code. #7662

Merged
merged 3 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tests/test_auto3dseg.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ def test_filename_case_analyzer(self):
for batch_data in self.dataset:
d = transform(batch_data[0])
assert DataStatsKeys.BY_CASE_IMAGE_PATH in d
assert DataStatsKeys.BY_CASE_IMAGE_PATH in d

def test_filename_case_analyzer_image_only(self):
analyzer_image = FilenameStats("image", DataStatsKeys.BY_CASE_IMAGE_PATH)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,15 +716,15 @@ def test_compose_execute_equivalence_with_flags(self, flags, data, pipeline):
for k in actual.keys():
self.assertEqual(expected[k], actual[k])
else:
self.assertTrue(expected, actual)
self.assertEqual(expected, actual)

p = deepcopy(pipeline)
actual = execute_compose(execute_compose(data, p, start=0, end=cutoff, **flags), p, start=cutoff, **flags)
if isinstance(actual, dict):
for k in actual.keys():
self.assertTrue(expected[k], actual[k])
self.assertEqual(expected[k], actual[k])
else:
self.assertTrue(expected, actual)
self.assertEqual(expected, actual)


class TestComposeCallableInput(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pad_collation.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def test_pad_collation(self, t_type, collate_method, transform):
batch_inverse = BatchInverseTransform(dataset.transform, loader)
for data in loader:
output = batch_inverse(data)
self.assertTrue(output[0]["image"].shape, (1, 10, 9))
self.assertEqual(output[0]["image"].shape, (1, 10, 9))


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion tests/test_to_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_list_tuple(self):
assert_allclose(result, np.asarray(test_data), type_test=False)
test_data = ((1, 2), (3, 4))
result = ToNumpy(wrap_sequence=False)(test_data)
self.assertTrue(type(result), tuple)
self.assertIsInstance(result, tuple)
assert_allclose(result, ((np.asarray(1), np.asarray(2)), (np.asarray(3), np.asarray(4))))

def test_single_value(self):
Expand Down
Loading