Skip to content

Commit 81eed24

Browse files
Make assert msg grammatically correct and less ambiguous (#74)
2 parents 92f1a01 + eddeb8f commit 81eed24

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/frequenz/channels/_anycast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def consume(self) -> T:
207207

208208
assert (
209209
self._next is not None
210-
), "calls to `consume()` must be follow a call to `ready()`"
210+
), "`consume()` must be preceeded by a call to `ready()`"
211211
next_val = self._next
212212
self._next = None
213213
return next_val

src/frequenz/channels/_broadcast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def consume(self) -> T:
313313
if not self._q and self._chan.closed:
314314
raise ReceiverStoppedError(self) from ChannelClosedError(self._chan)
315315

316-
assert self._q, "calls to `consume()` must be follow a call to `ready()`"
316+
assert self._q, "`consume()` must be preceeded by a call to `ready()`"
317317
return self._q.popleft()
318318

319319
def into_peekable(self) -> Peekable[T]:

src/frequenz/channels/util/_file_watcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def consume(self) -> pathlib.Path:
103103
if not self._changes and self._awatch_stopped_exc is not None:
104104
raise ReceiverStoppedError(self) from self._awatch_stopped_exc
105105

106-
assert self._changes, "calls to `consume()` must be follow a call to `ready()`"
106+
assert self._changes, "`consume()` must be preceeded by a call to `ready()`"
107107
change = self._changes.pop()
108108
# Tuple of (Change, path) returned by watchfiles
109109
_, path_str = change

src/frequenz/channels/util/_merge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,6 @@ def consume(self) -> T:
105105
if not self._results and not self._pending:
106106
raise ReceiverStoppedError(self)
107107

108-
assert self._results, "calls to `consume()` must be follow a call to `ready()`"
108+
assert self._results, "`consume()` must be preceeded by a call to `ready()`"
109109

110110
return self._results.popleft()

src/frequenz/channels/util/_merge_named.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,6 @@ def consume(self) -> Tuple[str, T]:
9393
if not self._results and not self._pending:
9494
raise ReceiverStoppedError(self)
9595

96-
assert self._results, "calls to `consume()` must be follow a call to `ready()`"
96+
assert self._results, "`consume()` must be preceeded by a call to `ready()`"
9797

9898
return self._results.popleft()

src/frequenz/channels/util/_timer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def consume(self) -> datetime:
129129

130130
assert (
131131
self._now is not None
132-
), "calls to `consume()` must be follow a call to `ready()`"
132+
), "`consume()` must be preceeded by a call to `ready()`"
133133
now = self._now
134134
self._now = None
135135
return now

0 commit comments

Comments
 (0)