summaryrefslogtreecommitdiffstats
path: root/Lib/unittest
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-03-22 01:46:47 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-03-22 01:46:47 (GMT)
commit434ae7703d08ab47dab0fcf9f382bbe7ae2996a1 (patch)
treec5a5f1eb91b447a65ea9fe6b8c3d10ab06899ed3 /Lib/unittest
parent8769fd8a17dad1b1861c04ea75ce46478d21a34d (diff)
downloadcpython-434ae7703d08ab47dab0fcf9f382bbe7ae2996a1.zip
cpython-434ae7703d08ab47dab0fcf9f382bbe7ae2996a1.tar.gz
cpython-434ae7703d08ab47dab0fcf9f382bbe7ae2996a1.tar.bz2
Merged revisions 79268 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r79268 | michael.foord | 2010-03-21 20:41:11 -0500 (Sun, 21 Mar 2010) | 1 line Removing Python 2.3 compatibility code from unittest. ........
Diffstat (limited to 'Lib/unittest')
-rw-r--r--Lib/unittest/loader.py6
-rw-r--r--Lib/unittest/main.py3
2 files changed, 2 insertions, 7 deletions
diff --git a/Lib/unittest/loader.py b/Lib/unittest/loader.py
index eea5c13..5d11b6e 100644
--- a/Lib/unittest/loader.py
+++ b/Lib/unittest/loader.py
@@ -19,11 +19,7 @@ VALID_MODULE_NAME = re.compile(r'[_a-z]\w*\.py$', re.IGNORECASE)
def _make_failed_import_test(name, suiteClass):
- message = 'Failed to import test module: %s' % name
- if hasattr(traceback, 'format_exc'):
- # Python 2.3 compatibility
- # format_exc returns two frames of discover.py as well
- message += '\n%s' % traceback.format_exc()
+ message = 'Failed to import test module: %s\n%s' % (name, traceback.format_exc())
return _make_failed_test('ModuleImportFailure', name, ImportError(message),
suiteClass)
diff --git a/Lib/unittest/main.py b/Lib/unittest/main.py
index 63fbd16..1db7978 100644
--- a/Lib/unittest/main.py
+++ b/Lib/unittest/main.py
@@ -159,10 +159,9 @@ class TestProgram(object):
for name, value in zip(('start', 'pattern', 'top'), args):
setattr(options, name, value)
+ self.failfast = options.failfast
if options.verbose:
self.verbosity = 2
- if options.failfast:
- self.failfast = True
start_dir = options.start
pattern = options.pattern