Refactor tests and remove unused imports

- Cleaned up test files by removing unnecessary imports and unused parameters.
- Simplified test functions by eliminating redundant parameterization and consolidating logic.
- Updated test cases to directly use defined values instead of parameterized inputs where applicable.
- Enhanced readability and maintainability of the test code across various test files.
This commit is contained in:
2026-09-17 10:02:05 +08:00
parent ac7f5a7f6d
commit 0aeb61f818
22 changed files with 95 additions and 372 deletions

View File

@@ -62,8 +62,8 @@ def test_cleaned_sawtooth_smoothing_preserves_face_orientation(iterations):
assert np.all(np.sum(normals(original)*normals(points), axis=1) > 0)
@pytest.mark.parametrize("resolution,aspect", [(12, .5), (24, 2)])
def test_split_profile_tapers_within_boundary_band(resolution, aspect):
def test_split_profile_tapers_within_boundary_band():
resolution, aspect = 12, .5
obj, set_value = surface(step=6, resolution=resolution)
for vertex in obj.data.vertices:
vertex.co.x *= aspect
@@ -96,8 +96,7 @@ def test_split_profile_tapers_within_boundary_band(resolution, aspect):
@pytest.mark.parametrize("mode", [0, 1])
@pytest.mark.parametrize("reference", [0, 2])
def test_normal_blend_weights_balloon_and_keeps_full_shell_smoothing(mode, reference):
def test_normal_blend_weights_balloon_and_keeps_full_shell_smoothing(mode):
obj, set_value = surface(resolution=2)
group = obj.modifiers[0].node_group
# The production interface renames the Shell thickness socket after building.
@@ -121,6 +120,7 @@ def test_normal_blend_weights_balloon_and_keeps_full_shell_smoothing(mode, refer
group.links.new(store.outputs[0], next(n for n in group.nodes if n.type == "GROUP_OUTPUT").inputs["Geometry"])
modifier = obj.modifiers[0]
identifier = socket.identifier if mode else modifier_input_identifier(group, "Thickness", subtype="NONE")
reference = 2
set_value("Reference Depth", reference)
results = []
for amount in (0, .001, .01, 1):