Fixed #9031 -- Clarified the error message when the label used to run a specific test case method doesn't name a valid test case class. Thanks to Thomas Guettler for the suggestion and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9879 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2009-02-22 08:34:51 +00:00
parent 8569157664
commit 5f7c6a8d29
1 changed files with 29 additions and 27 deletions

View File

@ -97,6 +97,8 @@ def build_test(label):
except TypeError: except TypeError:
raise ValueError("Test label '%s' does not refer to a test class" % label) raise ValueError("Test label '%s' does not refer to a test class" % label)
else: # label is app.TestClass.test_method else: # label is app.TestClass.test_method
if not TestClass:
raise ValueError("Test label '%s' does not refer to a test class" % label)
return TestClass(parts[2]) return TestClass(parts[2])
# Python 2.3 compatibility: TestSuites were made iterable in 2.4. # Python 2.3 compatibility: TestSuites were made iterable in 2.4.