Unverified Commit b9e9c28f authored by vfdev's avatar vfdev Committed by GitHub
Browse files

Added missing assert (#6446)

parent 97bb6cb1
...@@ -793,7 +793,7 @@ class TestRandomColorOp: ...@@ -793,7 +793,7 @@ class TestRandomColorOp:
if p > 0.0: if p > 0.0:
fn.assert_called_once_with(inpt, **kwargs) fn.assert_called_once_with(inpt, **kwargs)
else: else:
fn.call_count == 0 assert fn.call_count == 0
class TestRandomPerspective: class TestRandomPerspective:
...@@ -1014,7 +1014,7 @@ class TestRandomErasing: ...@@ -1014,7 +1014,7 @@ class TestRandomErasing:
if p > 0.0: if p > 0.0:
fn.assert_called_once_with(erase_image_tensor_inpt, **params) fn.assert_called_once_with(erase_image_tensor_inpt, **params)
else: else:
fn.call_count == 0 assert fn.call_count == 0
class TestTransform: class TestTransform:
...@@ -1050,7 +1050,7 @@ class TestToImageTensor: ...@@ -1050,7 +1050,7 @@ class TestToImageTensor:
transform = transforms.ToImageTensor() transform = transforms.ToImageTensor()
transform(inpt) transform(inpt)
if inpt_type in (features.BoundingBox, str, int): if inpt_type in (features.BoundingBox, str, int):
fn.call_count == 0 assert fn.call_count == 0
else: else:
fn.assert_called_once_with(inpt, copy=transform.copy) fn.assert_called_once_with(inpt, copy=transform.copy)
...@@ -1067,7 +1067,7 @@ class TestToImagePIL: ...@@ -1067,7 +1067,7 @@ class TestToImagePIL:
transform = transforms.ToImagePIL() transform = transforms.ToImagePIL()
transform(inpt) transform(inpt)
if inpt_type in (features.BoundingBox, str, int): if inpt_type in (features.BoundingBox, str, int):
fn.call_count == 0 assert fn.call_count == 0
else: else:
fn.assert_called_once_with(inpt, copy=transform.copy) fn.assert_called_once_with(inpt, copy=transform.copy)
...@@ -1085,7 +1085,7 @@ class TestToPILImage: ...@@ -1085,7 +1085,7 @@ class TestToPILImage:
transform = transforms.ToPILImage() transform = transforms.ToPILImage()
transform(inpt) transform(inpt)
if inpt_type in (PIL.Image.Image, features.BoundingBox, str, int): if inpt_type in (PIL.Image.Image, features.BoundingBox, str, int):
fn.call_count == 0 assert fn.call_count == 0
else: else:
fn.assert_called_once_with(inpt, mode=transform.mode) fn.assert_called_once_with(inpt, mode=transform.mode)
...@@ -1103,7 +1103,7 @@ class TestToTensor: ...@@ -1103,7 +1103,7 @@ class TestToTensor:
transform = transforms.ToTensor() transform = transforms.ToTensor()
transform(inpt) transform(inpt)
if inpt_type in (features.Image, torch.Tensor, features.BoundingBox, str, int): if inpt_type in (features.Image, torch.Tensor, features.BoundingBox, str, int):
fn.call_count == 0 assert fn.call_count == 0
else: else:
fn.assert_called_once_with(inpt) fn.assert_called_once_with(inpt)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment