summaryrefslogtreecommitdiffstats
path: root/Lib/doctest.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2010-04-28 14:29:06 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2010-04-28 14:29:06 (GMT)
commitdfb45dfd048160a60b2165f25a2b1fb99ca0495d (patch)
treefabfed4a36184962d489ce58ed6a76ae7e2d7e0e /Lib/doctest.py
parent616de77779fe9732b54d2c7cddfea62afff28a88 (diff)
downloadcpython-dfb45dfd048160a60b2165f25a2b1fb99ca0495d.zip
cpython-dfb45dfd048160a60b2165f25a2b1fb99ca0495d.tar.gz
cpython-dfb45dfd048160a60b2165f25a2b1fb99ca0495d.tar.bz2
Issue 7490: make IGNORE_EXCEPTION_DETAIL also ignore details of the module containing the exception under test (original patch by Lennart Regebro)
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r--Lib/doctest.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py
index a9357b5..70d3359 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -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