diff options
author | Buck Golemon <workitharder@gmail.com> | 2011-04-30 20:31:01 -0700 |
---|---|---|
committer | Buck Golemon <workitharder@gmail.com> | 2011-04-30 20:31:01 -0700 |
commit | 5b2eeec0cc1d60bd552fc0eb3a818a72a23a7b2c (patch) | |
tree | dd9350d72e407cc09c74c1cae9a0792f1e56d91f /nose | |
parent | 3caefdad7c5f6eba672a4683877394bf282d9f54 (diff) | |
download | nose-5b2eeec0cc1d60bd552fc0eb3a818a72a23a7b2c.tar.gz |
Python3 prints the full module path to custom exceptions.
Munge them away for greater compatibility of doctests.
Diffstat (limited to 'nose')
-rw-r--r-- | nose/plugins/plugintest.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/nose/plugins/plugintest.py b/nose/plugins/plugintest.py index 7827a84..68e8941 100644 --- a/nose/plugins/plugintest.py +++ b/nose/plugins/plugintest.py @@ -311,13 +311,15 @@ def remove_stack_traces(out): | innermost\ last ) \) : ) - \s* $ # toss trailing whitespace on the header. - (?P<stack> .*?) # don't blink: absorb stuff until... - ^ (?P<msg> \w+ .*) # a line *starts* with alphanum. + \s* $ # toss trailing whitespace on the header. + (?P<stack> .*?) # don't blink: absorb stuff until... + ^(?=\w) # a line *starts* with alphanum. + .*?(?P<exception> \w+ ) # exception name + (?P<msg> [:\n] .*) # the rest """, re.VERBOSE | re.MULTILINE | re.DOTALL) blocks = [] for block in blankline_separated_blocks(out): - blocks.append(traceback_re.sub(r"\g<hdr>\n...\n\g<msg>", block)) + blocks.append(traceback_re.sub(r"\g<hdr>\n...\n\g<exception>\g<msg>", block)) return "".join(blocks) |