Revert change to traceback repr (#7535)
* Revert change to traceback repr * Add test and changelog entry * Restore *exact* prev output Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
This commit is contained in:
committed by
GitHub
parent
7ec6401ffa
commit
3a060b77e8
@@ -1,3 +1,4 @@
|
||||
import re
|
||||
import sys
|
||||
from types import FrameType
|
||||
from unittest import mock
|
||||
@@ -170,6 +171,15 @@ class TestTracebackEntry:
|
||||
assert len(source) == 6
|
||||
assert "assert False" in source[5]
|
||||
|
||||
def test_tb_entry_str(self):
|
||||
try:
|
||||
assert False
|
||||
except AssertionError:
|
||||
exci = ExceptionInfo.from_current()
|
||||
pattern = r" File '.*test_code.py':\d+ in test_tb_entry_str\n assert False"
|
||||
entry = str(exci.traceback[0])
|
||||
assert re.match(pattern, entry)
|
||||
|
||||
|
||||
class TestReprFuncArgs:
|
||||
def test_not_raise_exception_with_mixed_encoding(self, tw_mock) -> None:
|
||||
|
||||
Reference in New Issue
Block a user