[Zope3-checkins] SVN: zope.testing/trunk/src/zope/testing/testrunner/tests.py Fix a test failure introduced by Jonathan's patch:

Sidnei da Silva sidnei.da.silva at gmail.com
Fri Mar 12 11:22:28 EST 2010


Log message for revision 109930:
  Fix a test failure introduced by Jonathan's patch:
  
  - Normalize testtools traceback formatter output since size is
    dependent on the traceback content, which can vary.
  - Also normalize package versions of doctest/unittest by looking for
    doctest/__init__.py and unittest/__init__.py.
  
  

Changed:
  U   zope.testing/trunk/src/zope/testing/testrunner/tests.py

-=-
Modified: zope.testing/trunk/src/zope/testing/testrunner/tests.py
===================================================================
--- zope.testing/trunk/src/zope/testing/testrunner/tests.py	2010-03-12 16:07:59 UTC (rev 109929)
+++ zope.testing/trunk/src/zope/testing/testrunner/tests.py	2010-03-12 16:22:28 UTC (rev 109930)
@@ -70,12 +70,17 @@
         (re.compile(r' line \d+,', re.IGNORECASE), r' Line NNN,'),
         (re.compile(r' line {([a-z]+)}\d+{', re.IGNORECASE), r' Line {\1}NNN{'),
 
-        # omit traceback entries for unittest.py or doctest.py from
-        # output:
-        (re.compile(r'^ +File "[^\n]*(doctest|unittest|case).py", [^\n]+\n[^\n]+\n',
+        # testtools formatter includes a size hint, which can vary
+        # depending on the path included in the traceback.
+        (re.compile(r'traceback\n[A-F\d]+\\r', re.MULTILINE),
+         r'traceback\nXXX\\r'),
+
+        # omit traceback entries for unittest.py or doctest.py (and
+        # their package variants) from output:
+        (re.compile(r'^ +File "[^\n]*(doctest|unittest|case)(/__init__)?.py", [^\n]+\n[^\n]+\n',
                     re.MULTILINE),
          r''),
-        (re.compile(r'^{\w+} +File "{\w+}[^\n]*(doctest|unittest|case).py{\w+}", [^\n]+\n[^\n]+\n',
+        (re.compile(r'^{\w+} +File "{\w+}[^\n]*(doctest|unittest|case)(/__init__)?.py{\w+}", [^\n]+\n[^\n]+\n',
                     re.MULTILINE),
          r''),
         #(re.compile('^> [^\n]+->None$', re.M), '> ...->None'),
@@ -114,12 +119,17 @@
         (re.compile(r' line \d+,', re.IGNORECASE), r' Line NNN,'),
         (re.compile(r' line {([a-z]+)}\d+{', re.IGNORECASE), r' Line {\1}NNN{'),
 
-        # omit traceback entries for unittest.py or doctest.py from
-        # output:
-        (re.compile(r'^ +File "[^\n]*(doctest|unittest|case).py", [^\n]+\n[^\n]+\n',
+        # testtools formatter includes a size hint, which can vary
+        # depending on the path included in the traceback.
+        (re.compile(r'traceback\n[A-F\d]+\\r', re.MULTILINE),
+         r'traceback\nXXX\\r'),
+
+        # omit traceback entries for unittest.py or doctest.py (and
+        # their package variants) from output:
+        (re.compile(r'^ +File "[^\n]*(doctest|unittest|case)(/__init__)?.py", [^\n]+\n[^\n]+\n',
                     re.MULTILINE),
          r''),
-        (re.compile(r'^{\w+} +File "{\w+}[^\n]*(doctest|unittest|case).py{\w+}", [^\n]+\n[^\n]+\n',
+        (re.compile(r'^{\w+} +File "{\w+}[^\n]*(doctest|unittest|case)(/__init__)?.py{\w+}", [^\n]+\n[^\n]+\n',
                     re.MULTILINE),
          r''),
         (re.compile('import pdb; pdb'), 'Pdb()'), # Py 2.3



More information about the Zope3-Checkins mailing list