diff options
author | scoder <none@none> | 2009-12-15 14:52:56 +0100 |
---|---|---|
committer | scoder <none@none> | 2009-12-15 14:52:56 +0100 |
commit | fbe2332aa654e66ddedbfcefc09e5ff0c14821ba (patch) | |
tree | 7cee75eb5eee7e777deb0941fa3d19936af63c0d /test.py | |
parent | d93a48bdd7d3981dd850e7ad656253246d23978c (diff) | |
download | python-lxml-fbe2332aa654e66ddedbfcefc09e5ff0c14821ba.tar.gz |
[svn r4284] 2.2 branch merge: fix test runner in Py3.1
--HG--
branch : trunk
Diffstat (limited to 'test.py')
-rw-r--r-- | test.py | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -71,11 +71,18 @@ import types import getopt import unittest import traceback + try: set except NameError: from sets import Set as set +try: + # Python >=2.7 and >=3.2 + from unittest.runner import _TextTestResult +except ImportError: + from unittest import _TextTestResult + __metaclass__ = type def stderr(text): @@ -302,14 +309,14 @@ def get_test_hooks(test_files, cfg, tracer=None): return results -class CustomTestResult(unittest._TextTestResult): +class CustomTestResult(_TextTestResult): """Customised TestResult. It can show a progress bar, and displays tracebacks for errors and failures as soon as they happen, in addition to listing them all at the end. """ - __super = unittest._TextTestResult + __super = _TextTestResult __super_init = __super.__init__ __super_startTest = __super.startTest __super_stopTest = __super.stopTest |