Skip to content

Commit 5343394

Browse files
committed
test: run loop for top level groups only in reset_gitlab
1 parent d5b33f4 commit 5343394

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

tests/functional/conftest.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,8 @@ def reset_gitlab(gl: gitlab.Gitlab) -> None:
9595
logging.info(f"Deleting project: {project.path_with_namespace!r}")
9696
helpers.safe_delete(project)
9797

98-
for group in gl.groups.list():
99-
100-
# skip deletion of a descendant group to prevent scenarios where parent group gets deleted leaving a dangling descendant whose deletion will throw 404s.
101-
if group.parent_id:
102-
logging.info(
103-
f"Skipping deletion of {group.full_path} as it is a descendant group and will be removed when the parent group is deleted"
104-
)
105-
continue
106-
98+
# skip deletion of a descendant group to prevent scenarios where parent group gets deleted leaving a dangling descendant whose deletion will throw 404s.
99+
for group in gl.groups.list(top_level_only=True):
107100
for deploy_token in group.deploytokens.list():
108101
logging.info(
109102
f"Deleting deploy token: {deploy_token.username!r} in "

0 commit comments

Comments
 (0)