summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBuck Golemon <workitharder@gmail.com>2011-04-30 20:31:01 -0700
committerBuck Golemon <workitharder@gmail.com>2011-04-30 20:31:01 -0700
commit5b2eeec0cc1d60bd552fc0eb3a818a72a23a7b2c (patch)
treedd9350d72e407cc09c74c1cae9a0792f1e56d91f
parent3caefdad7c5f6eba672a4683877394bf282d9f54 (diff)
downloadnose-5b2eeec0cc1d60bd552fc0eb3a818a72a23a7b2c.tar.gz
Python3 prints the full module path to custom exceptions.
Munge them away for greater compatibility of doctests.
-rw-r--r--functional_tests/doc_tests/test_issue142/errorclass_failure.rst.py3.patch38
-rw-r--r--nose/plugins/plugintest.py10
2 files changed, 6 insertions, 42 deletions
diff --git a/functional_tests/doc_tests/test_issue142/errorclass_failure.rst.py3.patch b/functional_tests/doc_tests/test_issue142/errorclass_failure.rst.py3.patch
deleted file mode 100644
index f598a64..0000000
--- a/functional_tests/doc_tests/test_issue142/errorclass_failure.rst.py3.patch
+++ /dev/null
@@ -1,38 +0,0 @@
---- errorclass_failure.rst.orig 2010-08-31 10:39:35.000000000 -0700
-+++ errorclass_failure.rst 2010-08-31 10:40:26.000000000 -0700
-@@ -30,7 +30,7 @@
- ----------------------------------------------------------------------
- Traceback (most recent call last):
- ...
-- Todo: fix me
-+ errorclass_failure_plugin.Todo: fix me
- <BLANKLINE>
- ----------------------------------------------------------------------
- Ran 2 tests in ...s
-@@ -49,7 +49,7 @@
- ----------------------------------------------------------------------
- Traceback (most recent call last):
- ...
-- Todo: fix me
-+ errorclass_failure_plugin.Todo: fix me
- <BLANKLINE>
- ----------------------------------------------------------------------
- Ran 1 test in ...s
-@@ -95,7 +95,7 @@
- ----------------------------------------------------------------------
- Traceback (most recent call last):
- ...
-- Todo: fix me
-+ errorclass_failure_plugin.Todo: fix me
- <BLANKLINE>
- ----------------------------------------------------------------------
- Ran 6 tests in ...s
-@@ -114,7 +114,7 @@
- ----------------------------------------------------------------------
- Traceback (most recent call last):
- ...
-- Todo: fix me
-+ errorclass_failure_plugin.Todo: fix me
- <BLANKLINE>
- ----------------------------------------------------------------------
- Ran 6 tests in ...s
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)