Add help message for method-missing scenario in tests.

(We now have a full replacement for TestResult, but we don't
support the full API of TestResult.  If folks were to add new
tests that caused TestCase to call our class with an unsupported
method, this diff will provide hopefully a more clear error
message.)

(imported from commit 92033b12a1a901bd649ecb03e08779aa76bfef7a)
This commit is contained in:
Steve Howell 2013-06-19 16:17:41 -04:00
parent f2f9fb7c3b
commit ad03644371
1 changed files with 9 additions and 0 deletions

View File

@ -2953,6 +2953,15 @@ class MyResult:
print ''.join(traceback.format_exception(exctype, value, tb))
sys.exit(1)
def __getattr__(self, attr):
print
print 'Attribute %s not supported' % attr
print '''
We have our own implementation of a result class that
may no longer be playing nice with the latest Django.
'''
sys.exit(1)
class Runner(DjangoTestSuiteRunner):
option_list = ()