pythoscope crash on test generation

Bug #344220 reported by Pieter Van Dyck on 2009-03-17
Affects Status Importance Assigned to Milestone
Michal Kwiatkowski

Bug Description

I'm trying pythoscope on iTrade to get the hang of both.
While pythoscope starts generating tests, it seems to go fine for a while, then it crashes when it reaches a specific module.
Removing the module fixes the crash.

cd project
pythoscope --init
pythoscope *.py

ERROR: Oops, it seems internal Pythoscope error occured. Please file a bug report at

Traceback (most recent call last):
  File "C:\Python25\Scripts\", line 8, in <module>
    load_entry_point('pythoscope==0.4', 'console_scripts', 'pythoscope')()
  File "c:\python25\lib\site-packages\pythoscope-0.4-py2.5.egg\pythoscope\", line 182, in main
    generate_tests(args, force, template)
  File "c:\python25\lib\site-packages\pythoscope-0.4-py2.5.egg\pythoscope\", line 111, in generate_tests
    add_tests_to_project(project, modules, template, force)
  File "c:\python25\lib\site-packages\pythoscope-0.4-py2.5.egg\pythoscope\generator\", line 837, in add_tests_to_project
    generator.add_tests_to_project(project, modnames, force)
  File "c:\python25\lib\site-packages\pythoscope-0.4-py2.5.egg\pythoscope\generator\", line 580, in add_tests_to_project
    self._add_tests_for_module(module, project, force)
  File "c:\python25\lib\site-packages\pythoscope-0.4-py2.5.egg\pythoscope\generator\", line 608, in _add_tests_for_module
    for test_case in self._generate_test_cases(module):
  File "c:\python25\lib\site-packages\pythoscope-0.4-py2.5.egg\pythoscope\generator\", line 613, in _generate_test_cases
    test_case = self._generate_test_case(object, module)
  File "c:\python25\lib\site-packages\pythoscope-0.4-py2.5.egg\pythoscope\generator\", line 619, in _generate_test_case
    method_descriptions = sorted_test_method_descriptions(self._generate_test_method_descriptions(object, module))
  File "c:\python25\lib\site-packages\pythoscope-0.4-py2.5.egg\pythoscope\generator\", line 448, in sorted_test_method_descriptions
    return sorted(descriptions, key=lambda md:
  File "c:\python25\lib\site-packages\pythoscope-0.4-py2.5.egg\pythoscope\generator\", line 674, in _generate_test_method_descriptions_for_class
    yield self._generate_test_method_description_for_method(klass, method)
  File "c:\python25\lib\site-packages\pythoscope-0.4-py2.5.egg\pythoscope\generator\", line 684, in _generate_test_method_description_for_method
  File "c:\python25\lib\site-packages\pythoscope-0.4-py2.5.egg\pythoscope\generator\", line 474, in assertion_stub
    return ('equal_stub', 'expected', call_with_args(callable, args))
  File "c:\python25\lib\site-packages\pythoscope-0.4-py2.5.egg\pythoscope\generator\", line 468, in call_with_args
    return "%s(%s)" % (callable, ', '.join(args))
TypeError: sequence item 0: expected string, tuple found

Related branches

Michal Kwiatkowski (ruby) wrote :

Confirming bug in current trunk.

Pythoscope fails during test generation for module taken from iTrade release 0.4.6.

Changed in pythoscope:
assignee: nobody → ruby
importance: Undecided → High
milestone: none → 0.4.1-setup-and-teardown-fixes
status: New → Confirmed
Michal Kwiatkowski (ruby) wrote :

This bug is related to using nested arguments, for example in formatException method of the myColorFormatter class:

> class myColorFormatter(Formatter):
> def formatException(self, (E, e, tb)):

Work on this bug is being done in the itrade-fixes branch.

Michal Kwiatkowski (ruby) wrote :

Fix committed into the itrade-fixes branch. Successfully tested on all Python files from the iTrade distribution. Both inspection and generation of test stubs work OK now.

Changed in pythoscope:
status: Confirmed → Fix Committed
Michal Kwiatkowski (ruby) wrote :

Fix released in 0.4.1.

Changed in pythoscope:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers