Skip to content

Commit 1c56f26

Browse files
test: Fix slow tests (#1832)
Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent 68c15ea commit 1c56f26

File tree

7 files changed

+20
-19
lines changed

7 files changed

+20
-19
lines changed

doc/changelog.d/1832.test.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix slow tests
Binary file not shown.
Binary file not shown.
Binary file not shown.

tests/integration/files/gear.scdocx

-814 KB
Binary file not shown.

tests/integration/test_design_import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def test_design_import_with_named_selections(modeler: Modeler):
355355
design = modeler.open_file(Path(FILES_DIR, "NamedSelectionImport.scdocx"))
356356

357357
# Check that there are 29 Named Selections
358-
assert len(design.named_selections) == 6
358+
assert len(design.named_selections) == 4
359359

360360
# Get named selection nozzle1
361361
nozzle1 = design._named_selections["n1"]

tests/integration/test_repair_tools.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,12 @@ def test_find_and_fix_extra_edges_in_components(modeler: Modeler):
338338
def test_find_and_fix_inexact_edges(modeler: Modeler):
339339
"""Test to read geometry, find and fix inexact edges and validate they are fixed removed."""
340340
design = modeler.open_file(FILES_DIR / "gear.scdocx")
341-
assert len(design.bodies[0].edges) == 993
341+
assert len(design.bodies[0].edges) == 310
342342
inexact_edges = modeler.repair_tools.find_inexact_edges(design.bodies)
343-
assert len(inexact_edges) == 272
343+
assert len(inexact_edges) == 73
344344
for i in inexact_edges:
345345
i.fix()
346-
assert len(design.bodies[0].edges) == 993
346+
assert len(design.bodies[0].edges) == 310
347347
inexact_edges = modeler.repair_tools.find_inexact_edges(design.bodies)
348348
assert len(inexact_edges) == 0
349349

@@ -382,15 +382,15 @@ def test_find_and_fix_short_edges_problem_areas(modeler: Modeler):
382382
def test_find_and_fix_split_edges_problem_areas(modeler: Modeler):
383383
"""Test to read geometry, find and fix split edges and validate they are fixed removed."""
384384
design = modeler.open_file(FILES_DIR / "bracket-with-split-edges.scdocx")
385-
assert len(design.bodies[0].edges) == 304
385+
assert len(design.bodies[0].edges) == 158
386386
split_edges = modeler.repair_tools.find_split_edges(design.bodies, 2.61799, 0.01)
387-
assert len(split_edges) == 166
387+
assert len(split_edges) == 86
388388
for i in split_edges:
389389
try: # Try/Except is a workaround. Having .alive would be better
390390
i.fix()
391391
except Exception:
392392
pass
393-
assert len(design.bodies[0].edges) == 169
393+
assert len(design.bodies[0].edges) == 99
394394

395395

396396
def test_find_and_stitch_and_missing_faces(modeler: Modeler):
@@ -412,14 +412,14 @@ def test_find_and_stitch_and_missing_faces(modeler: Modeler):
412412

413413
def test_find_simplify(modeler: Modeler):
414414
"""Test to read geometry and find it's unsimplified face problem areas."""
415-
design = modeler.open_file(FILES_DIR / "SOBracket2.scdocx")
415+
design = modeler.open_file(FILES_DIR / "SOBracket2_HalfModel.scdocx")
416416
problem_areas = modeler.repair_tools.find_simplify(design.bodies)
417-
assert len(problem_areas) == 46
417+
assert len(problem_areas) == 23
418418

419419

420420
def test_fix_simplify(modeler: Modeler):
421421
"""Test to read geometry and find and fix it's unsimplified face problem areas."""
422-
design = modeler.open_file(FILES_DIR / "SOBracket2.scdocx")
422+
design = modeler.open_file(FILES_DIR / "SOBracket2_HalfModel.scdocx")
423423
problem_areas = modeler.repair_tools.find_simplify(design.bodies)
424424
assert problem_areas[0].fix().success is True
425425

@@ -435,9 +435,9 @@ def test_find_and_fix_short_edges(modeler: Modeler):
435435
def test_find_and_fix_split_edges(modeler: Modeler):
436436
"""Test to read geometry, find and fix split edges and validate they are fixed removed."""
437437
design = modeler.open_file(FILES_DIR / "bracket-with-split-edges.scdocx")
438-
assert len(design.bodies[0].edges) == 304
438+
assert len(design.bodies[0].edges) == 158
439439
modeler.repair_tools.find_and_fix_split_edges(design.bodies, 2.61799, 0.01)
440-
assert len(design.bodies[0].edges) == 138
440+
assert len(design.bodies[0].edges) == 72
441441

442442

443443
def test_find_and_fix_extra_edges(modeler: Modeler):
@@ -493,11 +493,11 @@ def test_find_and_fix_short_edges_comprehensive(modeler: Modeler):
493493
def test_find_and_fix_split_edges_comprehensive(modeler: Modeler):
494494
"""Test to read geometry, find and fix split edges and validate they are fixed removed."""
495495
design = modeler.open_file(FILES_DIR / "bracket-with-split-edges.scdocx")
496-
assert len(design.bodies[0].edges) == 304
496+
assert len(design.bodies[0].edges) == 158
497497
result = modeler.repair_tools.find_and_fix_split_edges(design.bodies, 2.61799, 0.01, True)
498-
assert len(design.bodies[0].edges) == 169
499-
assert result.found == 135
500-
assert result.repaired == 135
498+
assert len(design.bodies[0].edges) == 99
499+
assert result.found == 59
500+
assert result.repaired == 59
501501

502502

503503
def test_find_and_fix_extra_edges_comprehensive(modeler: Modeler):
@@ -520,8 +520,8 @@ def test_find_and_fix_extra_edges_comprehensive(modeler: Modeler):
520520

521521
def test_find_and_fix_simplify(modeler: Modeler):
522522
"""Test to read geometry and find and fix spline faces"""
523-
design = modeler.open_file(FILES_DIR / "SOBracket2.scdocx")
523+
design = modeler.open_file(FILES_DIR / "SOBracket2_HalfModel.scdocx")
524524
result = modeler.repair_tools.find_and_fix_simplify(design.bodies, True)
525525
assert result
526-
assert result.found == 46
527-
assert result.repaired == 46 # There is a SC bug where success is always true
526+
assert result.found == 23
527+
assert result.repaired == 23 # There is a SC bug where success is always true

0 commit comments

Comments
 (0)