~ubuntu-branches/debian/wheezy/lxml/wheezy

« back to all changes in this revision

Viewing changes to test.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-10 11:32:29 UTC
  • mfrom: (1.3.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100310113229-nydaajy3eky89scu
Tags: 2.2.6-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
import getopt
72
72
import unittest
73
73
import traceback
 
74
 
74
75
try:
75
76
    set
76
77
except NameError:
77
78
    from sets import Set as set
78
79
 
 
80
try:
 
81
    # Python >=2.7 and >=3.2
 
82
    from unittest.runner import _TextTestResult
 
83
except ImportError:
 
84
    from unittest import _TextTestResult
 
85
 
79
86
__metaclass__ = type
80
87
 
81
88
def stderr(text):
302
309
    return results
303
310
 
304
311
 
305
 
class CustomTestResult(unittest._TextTestResult):
 
312
class CustomTestResult(_TextTestResult):
306
313
    """Customised TestResult.
307
314
 
308
315
    It can show a progress bar, and displays tracebacks for errors and failures
309
316
    as soon as they happen, in addition to listing them all at the end.
310
317
    """
311
318
 
312
 
    __super = unittest._TextTestResult
 
319
    __super = _TextTestResult
313
320
    __super_init = __super.__init__
314
321
    __super_startTest = __super.startTest
315
322
    __super_stopTest = __super.stopTest