Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3211)

Issue 810044: Python issue #7559: ImportErrors in unittest.TestLoader.loadTestFromName()

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years ago by cjerdonek
Modified:
8 years, 4 months ago
Reviewers:
Base URL:
http://svn.python.org/view/*checkout*/python/trunk/
Visibility:
Public.

Description

Patch to Python 2.7a4+ trunk for-- http://bugs.python.org/issue7559 The method unittest.TestLoader.loadTestsFromName() now lets ImportErrors bubble up if a bad import statement is encountered while loading a nested module. Before the method raised an AttributeError. The patch also includes code adapted from http://twistedmatrix.com .

Patch Set 1 #

Patch Set 2 : Patch from: http://bugs.python.org/issue7559#msg102719 #

Patch Set 3 : Added new unit test; incorporated unit test context manager suggestion; other clean-up. #

Total comments: 3

Patch Set 4 : Switched from ImportError to AttributeError after python-dev discussion. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+254 lines, -1 line) Patch
M Lib/unittest/loader.py View 1 2 3 2 chunks +43 lines, -1 line 0 comments Download
M Lib/unittest/test/test_loader.py View 1 2 3 2 chunks +207 lines, -0 lines 0 comments Download
M Misc/NEWS View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 1
cjerdonek
14 years ago (2010-04-11 13:37:24 UTC) #1
Minor code comment suggestions.

http://codereview.appspot.com/810044/diff/14001/5004
File Lib/unittest/loader.py (right):

http://codereview.appspot.com/810044/diff/14001/5004#newcode79
Lib/unittest/loader.py:79: #
http://twistedmatrix.com/trac/browser/trunk/twisted/python/reflect.py#L382
It would be better to include a revision number in this link so the line number
remains valid over time:

http://twistedmatrix.com/trac/browser/trunk/twisted/python/reflect.py?rev=281...

http://codereview.appspot.com/810044/diff/14001/5003
File Lib/unittest/test/test_loader.py (right):

http://codereview.appspot.com/810044/diff/14001/5003#newcode276
Lib/unittest/test/test_loader.py:276: # relying on the form of the stack trace
in certain ways.
We may want to mention the issue 7559 discussion here for reference purposes.

http://codereview.appspot.com/810044/diff/14001/5003#newcode284
Lib/unittest/test/test_loader.py:284: """Import a module."""
Probably just delete this doc string.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b