Skip to content

Commit 9e12551

Browse files
authored
Make tests run faster (#745)
The tests were previously taking 2 minutes, not they take 4 seconds
1 parent c0cd903 commit 9e12551

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/test_transforms.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -990,10 +990,10 @@ def test_rotate(self):
990990
assert np.all(np.array(result_a) == np.array(result_b))
991991

992992
def test_affine(self):
993-
input_img = np.zeros((200, 200, 3), dtype=np.uint8)
993+
input_img = np.zeros((40, 40, 3), dtype=np.uint8)
994994
pts = []
995-
cnt = [100, 100]
996-
for pt in [(80, 80), (100, 80), (100, 100)]:
995+
cnt = [20, 20]
996+
for pt in [(16, 16), (20, 16), (20, 20)]:
997997
for i in range(-5, 5):
998998
for j in range(-5, 5):
999999
input_img[pt[0] + i, pt[1] + j, :] = [255, 155, 55]
@@ -1028,7 +1028,7 @@ def _test_transformation(a, t, s, sh):
10281028
translate=t, scale=s, shear=sh))
10291029
assert np.sum(np.abs(true_matrix - result_matrix)) < 1e-10
10301030
# 2) Perform inverse mapping:
1031-
true_result = np.zeros((200, 200, 3), dtype=np.uint8)
1031+
true_result = np.zeros((40, 40, 3), dtype=np.uint8)
10321032
inv_true_matrix = np.linalg.inv(true_matrix)
10331033
for y in range(true_result.shape[0]):
10341034
for x in range(true_result.shape[1]):

0 commit comments

Comments
 (0)