Skip to content

Commit 97b1bd9

Browse files
committed
QA: Remove NotImplementedError() lines in abstract methods from coverage
1 parent 7a37190 commit 97b1bd9

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

lookups/generic_lookup.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def begin_transaction(self, ensure: int) -> Transaction:
349349
* >= 0: the amount of objects at the end
350350
:return: A transaction object
351351
'''
352-
raise NotImplementedError()
352+
raise NotImplementedError() # pragma: no cover
353353

354354
@abstractmethod
355355
def end_transaction(self, transaction: Transaction) -> Iterable[GLResult]:
@@ -359,7 +359,7 @@ def end_transaction(self, transaction: Transaction) -> Iterable[GLResult]:
359359
:param transaction: The transaction object.
360360
:return: The results affected by a change.
361361
'''
362-
raise NotImplementedError()
362+
raise NotImplementedError() # pragma: no cover
363363

364364
@abstractmethod
365365
def lookup(self, cls: Type[object]) -> Iterable[Pair]:
@@ -369,7 +369,7 @@ def lookup(self, cls: Type[object]) -> Iterable[Pair]:
369369
:param cls: The class to search for.
370370
:return: Iterable of Item
371371
'''
372-
raise NotImplementedError()
372+
raise NotImplementedError() # pragma: no cover
373373

374374
@abstractmethod
375375
def register_result(self, result: GLResult) -> None:
@@ -378,11 +378,11 @@ def register_result(self, result: GLResult) -> None:
378378
379379
:param result: The new result to remember.
380380
'''
381-
raise NotImplementedError()
381+
raise NotImplementedError() # pragma: no cover
382382

383383
@abstractmethod
384384
def find_result(self, cls: Type[object]) -> Optional[GLResult]:
385-
raise NotImplementedError()
385+
raise NotImplementedError() # pragma: no cover
386386

387387

388388
class Transaction(ABC):
@@ -397,7 +397,7 @@ def add(self, pair: Pair) -> bool:
397397
:return: True if the Item has been added for the first time or False if some other item
398398
equal to this one already existed in the lookup
399399
'''
400-
raise NotImplementedError()
400+
raise NotImplementedError() # pragma: no cover
401401

402402
@abstractmethod
403403
def remove(self, pair: Pair) -> None:
@@ -406,7 +406,7 @@ def remove(self, pair: Pair) -> None:
406406
407407
:param item: Item to remove.
408408
'''
409-
raise NotImplementedError()
409+
raise NotImplementedError() # pragma: no cover
410410

411411
@abstractmethod
412412
def set_all(self, pairs: Collection[Pair]) -> None:
@@ -415,7 +415,7 @@ def set_all(self, pairs: Collection[Pair]) -> None:
415415
416416
:param pairs: The collection of class/instance pairs.
417417
'''
418-
raise NotImplementedError()
418+
raise NotImplementedError() # pragma: no cover
419419

420420
@abstractmethod
421421
def new_content(self, prev: Collection[Pair]) -> Tuple[Collection[Pair], Set[Pair]]:
@@ -425,4 +425,4 @@ def new_content(self, prev: Collection[Pair]) -> Tuple[Collection[Pair], Set[Pai
425425
:param prev: The previous content.
426426
:return: Tuple of new content, set of changes.
427427
'''
428-
raise NotImplementedError()
428+
raise NotImplementedError() # pragma: no cover

lookups/instance_content.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def convert(self, obj: object) -> object:
111111
:param obj: The registered object.
112112
:return: The object converted from this object.
113113
'''
114-
raise NotImplementedError()
114+
raise NotImplementedError() # pragma: no cover
115115

116116
@abstractmethod
117117
def type(self, obj: object) -> Type[object]:
@@ -124,7 +124,7 @@ def type(self, obj: object) -> Type[object]:
124124
:return: The class that will be produced from this object (class or superclass of
125125
convert(obj))
126126
'''
127-
raise NotImplementedError()
127+
raise NotImplementedError() # pragma: no cover
128128

129129
@abstractmethod
130130
def id(self, obj: object) -> str:
@@ -136,7 +136,7 @@ def id(self, obj: object) -> str:
136136
:param obj: The registered object.
137137
:return: The ID for the object.
138138
'''
139-
raise NotImplementedError()
139+
raise NotImplementedError() # pragma: no cover
140140

141141
@abstractmethod
142142
def display_name(self, obj: object) -> str:
@@ -148,7 +148,7 @@ def display_name(self, obj: object) -> str:
148148
:param obj: The registered object.
149149
:return: The name representing the object for the user.
150150
'''
151-
raise NotImplementedError()
151+
raise NotImplementedError() # pragma: no cover
152152

153153

154154
class SimpleItem(LookupItem, Pair):

lookups/lookup.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def lookup(self, cls: Type[object]) -> Optional[object]:
5656
:param cls: Class or type of the object we are searching for.
5757
:return: An object implementing the given type or None if no such implementation is found.
5858
'''
59-
raise NotImplementedError()
59+
raise NotImplementedError() # pragma: no cover
6060

6161
def __call__(self, cls: Type[object]) -> Optional[object]:
6262
return self.lookup(cls)
@@ -72,7 +72,7 @@ def lookup_result(self, cls: Type[object]) -> Result:
7272
:param cls: Class or type of the objects we are searching for.
7373
:return: A live object representing instances of that type.
7474
'''
75-
raise NotImplementedError()
75+
raise NotImplementedError() # pragma: no cover
7676

7777
def lookup_item(self, cls: Type[object]) -> Optional[Item]:
7878
'''
@@ -121,7 +121,7 @@ def get_display_name(self) -> str:
121121
122122
:return: The string suitable for presenting the object to a user.
123123
'''
124-
raise NotImplementedError()
124+
raise NotImplementedError() # pragma: no cover
125125

126126
@abstractmethod
127127
def get_id(self) -> str:
@@ -135,7 +135,7 @@ def get_id(self) -> str:
135135
136136
:return: A string ID of the item.
137137
'''
138-
raise NotImplementedError()
138+
raise NotImplementedError() # pragma: no cover
139139

140140
@abstractmethod
141141
def get_instance(self) -> Optional[object]:
@@ -144,7 +144,7 @@ def get_instance(self) -> Optional[object]:
144144
145145
:return: The instance or None if the instance cannot be created.
146146
'''
147-
raise NotImplementedError()
147+
raise NotImplementedError() # pragma: no cover
148148

149149
@abstractmethod
150150
def get_type(self) -> Type[object]:
@@ -153,7 +153,7 @@ def get_type(self) -> Type[object]:
153153
154154
:return: The class of the item.
155155
'''
156-
raise NotImplementedError()
156+
raise NotImplementedError() # pragma: no cover
157157

158158
def __str__(self) -> str:
159159
'''Show ID for debugging.'''
@@ -182,7 +182,7 @@ def result_changed(self, result: Result) -> None: ...
182182
183183
:param listener: The listener to add.
184184
'''
185-
raise NotImplementedError()
185+
raise NotImplementedError() # pragma: no cover
186186

187187
@abstractmethod
188188
def remove_lookup_listener(self, listener: Callable[[Result], None]) -> None:
@@ -191,7 +191,7 @@ def remove_lookup_listener(self, listener: Callable[[Result], None]) -> None:
191191
192192
:param listener: The listener to remove.
193193
'''
194-
raise NotImplementedError()
194+
raise NotImplementedError() # pragma: no cover
195195

196196
@abstractmethod
197197
def all_classes(self) -> AbstractSet[Type[object]]:
@@ -203,7 +203,7 @@ def all_classes(self) -> AbstractSet[Type[object]]:
203203
204204
:return: Immutable set of class objects.
205205
'''
206-
raise NotImplementedError()
206+
raise NotImplementedError() # pragma: no cover
207207

208208
@abstractmethod
209209
def all_instances(self) -> Sequence[object]:
@@ -212,7 +212,7 @@ def all_instances(self) -> Sequence[object]:
212212
213213
:return: Immutable sequence of all instances.
214214
'''
215-
raise NotImplementedError()
215+
raise NotImplementedError() # pragma: no cover
216216

217217
@abstractmethod
218218
def all_items(self) -> Sequence[Item]:
@@ -223,7 +223,7 @@ def all_items(self) -> Sequence[Item]:
223223
224224
:return: Immutable sequence of Item.
225225
'''
226-
raise NotImplementedError()
226+
raise NotImplementedError() # pragma: no cover
227227

228228

229229
class LookupProvider(ABC):
@@ -239,4 +239,4 @@ def get_lookup(self) -> Lookup:
239239
240240
:return: Fully initialized lookup instance provided by this object
241241
'''
242-
raise NotImplementedError()
242+
raise NotImplementedError() # pragma: no cover

0 commit comments

Comments
 (0)