Skip to content

Commit 111ecd3

Browse files
committed
Add a pragma: no cover statement to a continue line in method _connect_subgroup of class Model of module modeltools for which coveragepy otherwise reports missing coverage.
Due to CPython's peephole optimizer, see nedbat/coveragepy#198.
1 parent 63df4d5 commit 111ecd3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

hydpy/core/modeltools.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,9 +1149,9 @@ def element(self) -> None:
11491149
model.__hydpy_element__ = None
11501150

11511151
def connect(self) -> None:
1152-
"""Connect all |LinkSequence| objects and the selected |InputSequence|,
1153-
|ReceiverSequence|, and |OutputSequence| objects of the actual model to the
1154-
corresponding |NodeSequence| objects.
1152+
"""Connect all |LinkSequence| objects and the selected |InputSequence| and
1153+
|OutputSequence| objects of the actual model to the corresponding
1154+
|NodeSequence| objects.
11551155
11561156
You cannot connect any sequences until the |Model| object itself is connected
11571157
to an |Element| object referencing the required |Node| objects:
@@ -1542,7 +1542,8 @@ def _connect_subgroup(
15421542
if sequence.NDIM == 0:
15431543
if not selected_nodes:
15441544
if (group == "inputs") or not report_noconnect:
1545-
continue
1545+
# see https://github.com/nedbat/coveragepy/issues/198:
1546+
continue # pragma: no cover
15461547
raise RuntimeError(
15471548
f"Sequence {objecttools.elementphrase(sequence)} cannot "
15481549
f"be connected due to no available node handling variable "

0 commit comments

Comments
 (0)