Skip to content

Commit

Permalink
utest: Improve filtering of output sugar for Python 3.13+
Browse files Browse the repository at this point in the history
  • Loading branch information
fedepell committed Jan 26, 2024
1 parent dab162b commit c8f3ece
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utest/utils/test_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ def _verify_traceback(self, expected, method, *args):
tb = ErrorDetails(error).traceback
else:
raise AssertionError
# Remove lines indicating error location with `^^^^` used by Python 3.11+.
tb = '\n'.join(line for line in tb.splitlines() if line.strip('^ '))
# Remove lines indicating error location with `^^^^` used by Python 3.11+ and `~~~~^` variants in Python 3.13+.
tb = '\n'.join(line for line in tb.splitlines() if line.strip('^~ '))
if not re.match(expected, tb):
raise AssertionError('\nExpected:\n%s\n\nActual:\n%s' % (expected, tb))

Expand Down

0 comments on commit c8f3ece

Please sign in to comment.