pythoscope generate crashes with AttributeError: 'TestModule' object has no attribute 'testable_objects'

Bug #264449 reported by GrigGheorghiu on 2008-09-03
Affects Status Importance Assigned to Milestone
Michal Kwiatkowski

Bug Description

I have a collection of .py files that I want to be inspected by pythoscope, and unit test modules to be generated. Here's what I did (the modules are ones that I had already written):

[root@storm deploy]# ls show_slave_status.sql
[root@storm deploy]# pythoscope inspect *.py
[root@storm deploy]# pythoscope generate -t nose *.py
Traceback (most recent call last):
  File "/usr/bin/pythoscope", line 7, in ?
  File "/usr/lib/python2.4/site-packages/pythoscope-0.2.2-py2.4.egg/pythoscope/", line 137, in main
    generate(appname, args)
  File "/usr/lib/python2.4/site-packages/pythoscope-0.2.2-py2.4.egg/pythoscope/", line 102, in generate
    add_tests_to_project(project, args, destdir, template, force)
  File "/usr/lib/python2.4/site-packages/pythoscope-0.2.2-py2.4.egg/pythoscope/", line 112, in add_tests_to_project
    generator.add_tests_to_project(project, modnames, destdir, force)
  File "/usr/lib/python2.4/site-packages/pythoscope-0.2.2-py2.4.egg/pythoscope/", line 58, in add_tests_to_project
    self._add_tests_for_module(module, project, destdir, force)
  File "/usr/lib/python2.4/site-packages/pythoscope-0.2.2-py2.4.egg/pythoscope/", line 61, in _add_tests_for_module
    test_cases = self._generate_test_cases(module)
  File "/usr/lib/python2.4/site-packages/pythoscope-0.2.2-py2.4.egg/pythoscope/", line 67, in _generate_test_cases
    [self._generate_test_case(obj, module) \
AttributeError: 'TestModule' object has no attribute 'testable_objects'

Related branches

Michal Kwiatkowski (ruby) wrote :

Basically the problem is that you have test modules there and by calling "pythoscope generate -t nose *.py" you try to generate test cases for them. If you exclude those test modules from call to generate Pythoscope won't crash.

But of course Pythoscope should handle that and just ignore the test modules, so I'm confirming the bug.

Changed in pythoscope:
assignee: nobody → ruby
importance: Undecided → Medium
milestone: none → static-analysis
status: New → Confirmed
Michal Kwiatkowski (ruby) wrote :

Fixed in r103.

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

Fix released with Pythoscope 0.3.

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