#9031: Small bug if typo in testcase
-------------------------------+--------------------------------------------
 Reporter:  guettli            |       Owner:  nobody    
   Status:  new                |   Milestone:            
Component:  Testing framework  |     Version:  1.0       
 Keywords:                     |       Stage:  Unreviewed
Has_patch:  1                  |  
-------------------------------+--------------------------------------------
 If there is a typo in a testcase, you get an exception:

 {{{
 [EMAIL PROTECTED]:~/myproj> ./manage.py test myapp.hereisatypo.testSomething
 Traceback (most recent call last):
   File "./manage.py", line 11, in <module>
     execute_manager(etc.settings)
   File "/localhome/modw/django/core/management/__init__.py", line 340, in
 execute_manager
     utility.execute()
   File "/localhome/modw/django/core/management/__init__.py", line 295, in
 execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/localhome/modw/django/core/management/base.py", line 77, in
 run_from_argv
     self.execute(*args, **options.__dict__)
   File "/localhome/modw/django/core/management/base.py", line 96, in
 execute
     output = self.handle(*args, **options)
   File "/localhome/modw/django/core/management/commands/test.py", line 33,
 in handle
     failures = test_runner(test_labels, verbosity=verbosity,
 interactive=interactive)
   File "/localhome/modw/django/test/simple.py", line 129, in run_tests
     suite.addTest(build_test(label))
   File "/localhome/modw/django/test/simple.py", line 100, in build_test
     return TestClass(parts[2])
 TypeError: 'NoneType' object is not callable
 }}}

 The small patch results in a better error message:
 {{{
 [EMAIL PROTECTED]:~/myproj> ./manage.py test myapp.hereisatypo.testSomething
 Traceback (most recent call last):
   File "./manage.py", line 11, in <module>
     execute_manager(etc.settings)
   File "/localhome/modw/django/core/management/__init__.py", line 340, in
 execute_manager
     utility.execute()
   File "/localhome/modw/django/core/management/__init__.py", line 295, in
 execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/localhome/modw/django/core/management/base.py", line 77, in
 run_from_argv
     self.execute(*args, **options.__dict__)
   File "/localhome/modw/django/core/management/base.py", line 96, in
 execute
     output = self.handle(*args, **options)
   File "/localhome/modw/django/core/management/commands/test.py", line 33,
 in handle
     failures = test_runner(test_labels, verbosity=verbosity,
 interactive=interactive)
   File "/localhome/modw/django/test/simple.py", line 132, in run_tests
     suite.addTest(build_test(label))
   File "/localhome/modw/django/test/simple.py", line 102, in build_test
     parts[1], parts[0], parts[0]))
 ValueError: TestCase hereisatypo not found. Searched in myapp.models and
 myapp.tests
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9031>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to