Skip to content

Commit 78d4773

Browse files
committed
zip() function bool changed to strict=True in all these test cases. Most test cases either a) hardcode two things to be the same length, b) verify things are the same length before the function or c) explicitly exist to check whether two things are the same length.
1 parent 827d124 commit 78d4773

File tree

10 files changed

+12
-10
lines changed

10 files changed

+12
-10
lines changed

tests/module/mobject/geometry/test_unit_geometry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def test_Polygram_get_vertex_groups():
8989
for vertex_groups in vertex_groups_arr:
9090
polygram = Polygram(*vertex_groups)
9191
poly_vertex_groups = polygram.get_vertex_groups()
92-
for poly_group, group in zip(poly_vertex_groups, vertex_groups, strict=False):
92+
for poly_group, group in zip(poly_vertex_groups, vertex_groups, strict=True):
9393
np.testing.assert_array_equal(poly_group, group)
9494

9595
# If polygram is a Polygram of a vertex group containing the start vertex N times,

tests/module/mobject/graphing/test_number_line.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def test_add_labels():
6262
expected_label_length = 6
6363
num_line = NumberLine(x_range=[-4, 4])
6464
num_line.add_labels(
65-
dict(zip(list(range(-3, 3)), [Integer(m) for m in range(-1, 5)], strict=False)),
65+
dict(zip(list(range(-3, 3)), [Integer(m) for m in range(-1, 5)], strict=True)),
6666
)
6767
actual_label_length = len(num_line.labels)
6868
assert actual_label_length == expected_label_length, (

tests/module/mobject/text/test_texmobject.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def test_multi_part_tex_with_empty_parts():
108108
for one_part_glyph, multi_part_glyph in zip(
109109
one_part_fomula.family_members_with_points(),
110110
multi_part_formula.family_members_with_points(),
111-
strict=False,
111+
strict=True,
112112
):
113113
np.testing.assert_allclose(one_part_glyph.points, multi_part_glyph.points)
114114

tests/module/mobject/types/vectorized_mobject/test_vectorized_mobject.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def test_vdict_init():
369369
# Test VDict made from a python dict
370370
VDict({"a": VMobject(), "b": VMobject(), "c": VMobject()})
371371
# Test VDict made using zip
372-
VDict(zip(["a", "b", "c"], [VMobject(), VMobject(), VMobject()], strict=False))
372+
VDict(zip(["a", "b", "c"], [VMobject(), VMobject(), VMobject()], strict=True))
373373
# If the value is of type Mobject, must raise a TypeError
374374
with pytest.raises(TypeError):
375375
VDict({"a": Mobject()})

tests/opengl/test_number_line_opengl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def test_add_labels():
6262
expected_label_length = 6
6363
num_line = NumberLine(x_range=[-4, 4])
6464
num_line.add_labels(
65-
dict(zip(list(range(-3, 3)), [Integer(m) for m in range(-1, 5)], strict=False)),
65+
dict(zip(list(range(-3, 3)), [Integer(m) for m in range(-1, 5)], strict=True)),
6666
)
6767
actual_label_length = len(num_line.labels)
6868
assert actual_label_length == expected_label_length, (

tests/opengl/test_opengl_vectorized_mobject.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def test_vdict_init(using_opengl_renderer):
312312
zip(
313313
["a", "b", "c"],
314314
[OpenGLVMobject(), OpenGLVMobject(), OpenGLVMobject()],
315-
strict=False,
315+
strict=True,
316316
)
317317
)
318318
# If the value is of type OpenGLMobject, must raise a TypeError

tests/test_graphical_units/test_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_custom_coordinates(scene):
3232
ax = Axes(x_range=[0, 10])
3333

3434
ax.add_coordinates(
35-
dict(zip(list(range(1, 10)), [Tex("str") for _ in range(1, 10)], strict=False)),
35+
dict(zip(list(range(1, 10)), [Tex("str") for _ in range(1, 10)], strict=True)),
3636
)
3737
scene.add(ax)
3838

tests/test_graphical_units/test_mobjects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_vmobject_joint_types(scene):
5959
]
6060
)
6161
lines = VGroup(*[angled_line.copy() for _ in range(len(LineJointType))])
62-
for line, joint_type in zip(lines, LineJointType, strict=False):
62+
for line, joint_type in zip(lines, LineJointType, strict=True):
6363
line.joint_type = joint_type
6464

6565
lines.arrange(RIGHT, buff=1)

tests/utils/logging_tester.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ def _check_logs(reference_logfile_path: Path, generated_logfile_path: Path) -> N
2828
msg_assert += f"\nPath of reference log: {reference_logfile}\nPath of generated logs: {generated_logfile}"
2929
pytest.fail(msg_assert)
3030

31-
for index, ref, gen in zip(itertools.count(), reference_logs, generated_logs):
31+
for index, ref, gen in zip(
32+
itertools.count(), reference_logs, generated_logs, strict=False
33+
):
3234
# As they are string, we only need to check if they are equal. If they are not, we then compute a more precise difference, to debug.
3335
if ref == gen:
3436
continue

tests/utils/video_tester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def check_video_data(path_control_data: Path, path_video_gen: Path) -> None:
5959
f"expected {len(sec_index_exp)} sections ({', '.join([el['name'] for el in sec_index_exp])}), but {len(sec_index_gen)} ({', '.join([el['name'] for el in sec_index_gen])}) got generated (in '{path_sec_index_gen}')"
6060
)
6161
# check individual sections
62-
for sec_gen, sec_exp in zip(sec_index_gen, sec_index_exp, strict=False):
62+
for sec_gen, sec_exp in zip(sec_index_gen, sec_index_exp, strict=True):
6363
assert_shallow_dict_compare(
6464
sec_gen,
6565
sec_exp,

0 commit comments

Comments
 (0)