diff options
author | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-03-22 01:41:11 (GMT) |
---|---|---|
committer | Michael Foord <fuzzyman@voidspace.org.uk> | 2010-03-22 01:41:11 (GMT) |
commit | 49899690a8867029076b1a336678479750fd78c9 (patch) | |
tree | fc2935f33e09cf42908300cf02efaf744653c04a /Lib/unittest | |
parent | db003cb3d17ecac870d6af1b2c408f887a93f2e3 (diff) | |
download | cpython-49899690a8867029076b1a336678479750fd78c9.zip cpython-49899690a8867029076b1a336678479750fd78c9.tar.gz cpython-49899690a8867029076b1a336678479750fd78c9.tar.bz2 |
Removing Python 2.3 compatibility code from unittest.
Diffstat (limited to 'Lib/unittest')
-rw-r--r-- | Lib/unittest/loader.py | 6 | ||||
-rw-r--r-- | Lib/unittest/main.py | 3 |
2 files changed, 2 insertions, 7 deletions
diff --git a/Lib/unittest/loader.py b/Lib/unittest/loader.py index d6c8d84..022ed57 100644 --- a/Lib/unittest/loader.py +++ b/Lib/unittest/loader.py @@ -30,11 +30,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 f5b516c..8fd23c0 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 |