pythoscope crash on test generation

Bug #344220 reported by Pieter Van Dyck
2
Affects Status Importance Assigned to Milestone
Pythoscope
Fix Released
High
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 https://bugs.launchpad.net/pythoscope

Traceback (most recent call last):
  File "C:\Python25\Scripts\pythoscope-script.py", 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\__init__.py", line 182, in main
    generate_tests(args, force, template)
  File "c:\python25\lib\site-packages\pythoscope-0.4-py2.5.egg\pythoscope\__init__.py", 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\__init__.py", 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\__init__.py", 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\__init__.py", 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\__init__.py", 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\__init__.py", 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\__init__.py", line 448, in sorted_test_method_descriptions
    return sorted(descriptions, key=lambda md: md.name)
  File "c:\python25\lib\site-packages\pythoscope-0.4-py2.5.egg\pythoscope\generator\__init__.py", 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\__init__.py", line 684, in _generate_test_method_description_for_method
    method.get_call_args()))
  File "c:\python25\lib\site-packages\pythoscope-0.4-py2.5.egg\pythoscope\generator\__init__.py", 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\__init__.py", line 468, in call_with_args
    return "%s(%s)" % (callable, ', '.join(args))
TypeError: sequence item 0: expected string, tuple found

Related branches

Revision history for this message
Michal Kwiatkowski (ruby) wrote :

Confirming bug in current trunk.

Pythoscope fails during test generation for module itrade_logging.py 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
Revision history for this message
Michal Kwiatkowski (ruby) wrote :
Revision history for this message
Michal Kwiatkowski (ruby) wrote :

This bug is related to itrade_logging.py 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.

Revision history for this message
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
Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.