mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue 7490: make IGNORE_EXCEPTION_DETAIL also ignore details of the module containing the exception under test (original patch by Lennart Regebro)
This commit is contained in:
parent
616de77779
commit
dfb45dfd04
5 changed files with 118 additions and 26 deletions
|
@ -1282,9 +1282,9 @@ class DocTestRunner:
|
|||
|
||||
# Another chance if they didn't care about the detail.
|
||||
elif self.optionflags & IGNORE_EXCEPTION_DETAIL:
|
||||
m1 = re.match(r'[^:]*:', example.exc_msg)
|
||||
m2 = re.match(r'[^:]*:', exc_msg)
|
||||
if m1 and m2 and check(m1.group(0), m2.group(0),
|
||||
m1 = re.match(r'(?:[^:]*\.)?([^:]*:)', example.exc_msg)
|
||||
m2 = re.match(r'(?:[^:]*\.)?([^:]*:)', exc_msg)
|
||||
if m1 and m2 and check(m1.group(1), m2.group(1),
|
||||
self.optionflags):
|
||||
outcome = SUCCESS
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue