1. Jason Pellerin
  2. nose

Commits

Buck Evan  committed 6c885be

Python3 prints the full module path to custom exceptions.
Munge them away for greater compatibility of doctests.

  • Participants
  • Parent commits 10f966d
  • Branches default

Comments (0)

Files changed (2)

File functional_tests/doc_tests/test_issue142/errorclass_failure.rst.py3.patch

  • Ignore whitespace
---- 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

File nose/plugins/plugintest.py

View file
  • Ignore whitespace
             |   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)