On Tue, 2007-05-29 at 22:12 +0000, Rand Bradley wrote: > When I run my unit tests using 'manage.py test', I recently started > receiving the following exception: > > Traceback (most recent call last): > File "E:\dev\engage\src\engage\manage.py", line 11, in <module> > execute_manager(settings) > File "e:\dev\django\django\core\management.py", line 1678, in > execute_manager > execute_from_command_line(action_mapping, argv) > File "e:\dev\django\django\core\management.py", line 1592, in > execute_from_command_line > action_mapping[action](args[1:], int(options.verbosity)) > File "e:\dev\django\django\core\management.py", line 1309, in test > failures = test_runner(app_list, verbosity) > File "E:\dev\engage\src\engage\simple.py", line 87, in run_tests > suite.addTest(build_suite(module)) > File "E:\dev\engage\src\engage\simple.py", line 45, in build_suite > runner=DocTestRunner)) > File "C:\Python25\lib\doctest.py", line 2269, in DocTestSuite > suite.addTest(DocTestCase(test, **options)) > TypeError: __init__() got an unexpected keyword argument 'runner' > > I have traced back the exception and found that it started occurring > with revision 5306. Specifically, the doctest comments at the > beginning of the django\contrib\sessions\tests.py seem to be causing > the issue. If I delete the tests.py file, or simply remove the '>>>' > characters from the comments, the tests run fine. > > I do not think this is a result of my environment. I am running under > Windows XP, and have an isolated project environment set up by Ian > Bickings workingenv.py script. I did override simple.py in my project, > but only to remove the code that resets the database (by removing > create_test_db(verbosity), destroy_test_db(old_name, verbosity)). This > environment setup has worked fine until the check-in of django\contrib > \sessions\tests.py in revision 5306. > > Does anyone have any ideas? Have I discovered a strange Django or > Python bug?
This looks like perfectly normal Python behaviour at a guess: doctests are automatically pulled from any docstring in modules that are being searched, so the initial string in contrib.sessions.test would count as such a test. It has accidentally pulled in the Python 2.5 version of doctest, rather than using Django's version somewhere. There are some backwards-incompat changes between the Python 2.4 doctest.py (which is what is included in Django) and the Python 2.5 version. So we should always be using the Django version internally at the moment. This needs a bit more investigation. Can you file a ticket please, including most of the information you've written above. Thanks, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" 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-users?hl=en -~----------~----~----~----~------~----~------~--~---

