Skip to content

Commit

Permalink
Replace bare assert with check/raise. Workaround for jaraco/jaraco.te…
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Nov 21, 2020
1 parent e9f23a4 commit b0a39b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jaraco/itertools.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,9 @@ def assert_ordered(iterable, key=lambda x: x, comp=operator.le):
)
for pair in more_itertools.pairwise(iterable):
keyed = tuple(map(key, pair))
assert comp(*keyed), err_tmpl.format(**locals())
# cannot use bare assert due to jaraco/jaraco.test#3
if not comp(*keyed):
raise AssertionError(err_tmpl.format(**locals()))
yield pair[0]
yield pair[1]

Expand Down

0 comments on commit b0a39b4

Please sign in to comment.