Skip to content

Commit db530d8

Browse files
authored
More robust assertion checks in test_to_tensor_video (#4258)
1 parent d7fa36f commit db530d8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/test_transforms_video.py

+4
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,16 @@ def test_to_tensor_video(self):
133133
with pytest.raises(TypeError):
134134
np_rng = np.random.RandomState(0)
135135
trans(np_rng.rand(numFrames, height, width, 1).tolist())
136+
with pytest.raises(TypeError):
136137
trans(torch.rand((numFrames, height, width, 1), dtype=torch.float))
137138

138139
with pytest.raises(ValueError):
139140
trans(torch.ones((3, numFrames, height, width, 3), dtype=torch.uint8))
141+
with pytest.raises(ValueError):
140142
trans(torch.ones((height, width, 3), dtype=torch.uint8))
143+
with pytest.raises(ValueError):
141144
trans(torch.ones((width, 3), dtype=torch.uint8))
145+
with pytest.raises(ValueError):
142146
trans(torch.ones((3), dtype=torch.uint8))
143147

144148
trans.__repr__()

0 commit comments

Comments
 (0)