Skip to content

Commit 98ccc3c

Browse files
nejchJohnVillalovos
authored andcommitted
chore(cli): ignore coverage on exceptions triggering cli.die
1 parent 5d14867 commit 98ccc3c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

gitlab/v4/cli.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ def do_project_export_download(self) -> None:
125125
assert data is not None
126126
sys.stdout.buffer.write(data)
127127

128-
except Exception as e:
128+
except Exception as e: # pragma: no cover, cli.die is unit-tested
129129
cli.die("Impossible to download the export", e)
130130

131131
def do_create(self) -> gitlab.base.RESTObject:
132132
if TYPE_CHECKING:
133133
assert isinstance(self.mgr, gitlab.mixins.CreateMixin)
134134
try:
135135
result = self.mgr.create(self.args)
136-
except Exception as e:
136+
except Exception as e: # pragma: no cover, cli.die is unit-tested
137137
cli.die("Impossible to create object", e)
138138
return result
139139

@@ -144,15 +144,15 @@ def do_list(
144144
assert isinstance(self.mgr, gitlab.mixins.ListMixin)
145145
try:
146146
result = self.mgr.list(**self.args)
147-
except Exception as e:
147+
except Exception as e: # pragma: no cover, cli.die is unit-tested
148148
cli.die("Impossible to list objects", e)
149149
return result
150150

151151
def do_get(self) -> Optional[gitlab.base.RESTObject]:
152152
if isinstance(self.mgr, gitlab.mixins.GetWithoutIdMixin):
153153
try:
154154
result = self.mgr.get(id=None, **self.args)
155-
except Exception as e:
155+
except Exception as e: # pragma: no cover, cli.die is unit-tested
156156
cli.die("Impossible to get object", e)
157157
return result
158158

@@ -163,7 +163,7 @@ def do_get(self) -> Optional[gitlab.base.RESTObject]:
163163
id = self.args.pop(self.cls._id_attr)
164164
try:
165165
result = self.mgr.get(id, lazy=False, **self.args)
166-
except Exception as e:
166+
except Exception as e: # pragma: no cover, cli.die is unit-tested
167167
cli.die("Impossible to get object", e)
168168
return result
169169

@@ -174,7 +174,7 @@ def do_delete(self) -> None:
174174
id = self.args.pop(self.cls._id_attr)
175175
try:
176176
self.mgr.delete(id, **self.args)
177-
except Exception as e:
177+
except Exception as e: # pragma: no cover, cli.die is unit-tested
178178
cli.die("Impossible to destroy object", e)
179179

180180
def do_update(self) -> Dict[str, Any]:
@@ -189,7 +189,7 @@ def do_update(self) -> Dict[str, Any]:
189189

190190
try:
191191
result = self.mgr.update(id, self.args)
192-
except Exception as e:
192+
except Exception as e: # pragma: no cover, cli.die is unit-tested
193193
cli.die("Impossible to update object", e)
194194
return result
195195

0 commit comments

Comments
 (0)