Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions cadquery/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,8 @@ def add(self, arg, **kwargs):
# enforce unique names
name = kwargs["name"] if kwargs.get("name") else arg.name
if name in self.objects:
raise ValueError(
f"Unique name is required. {name} is already in the assembly"
)
# Add a incremented number to the name
name = f"{name}_{len(self.objects)}"

subassy = arg._copy()

Expand Down
6 changes: 0 additions & 6 deletions tests/test_assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -1792,12 +1792,6 @@ def test_constrain_with_tags(nested_assy):
nested_assy.constrain("SECOND/BOTTOM ? pts", "dummy", "Plane")


def test_duplicate_name(nested_assy):

with pytest.raises(ValueError):
nested_assy.add(None, name="SECOND")


def test_empty_solve(nested_assy):

with pytest.raises(ValueError):
Expand Down