Pythoscope, the unit test generator

Internal Pythoscope error

Reported by André Roberge on 2008-11-07
4
Affects Status Importance Assigned to Milestone
Pythoscope
Medium
Michal Kwiatkowski

Bug Description

Pythoscope asked me to register a bug; I've pasted below the traceback (with lines starting with INFO not included).

What I have attempted to do is perhaps a bit insane ;-)

I tried to run pythoscope on crunchy (http://code.google.com/p/crunchy) by first doing
pythoscope --init
and then creating a point of entry with the following code in it:
#====
# .pythoscope/points-of-entry/crunchy_test.py
from crunchy import run_crunchy
run_crunchy(port=8001, url="/index.html")
#===

and ran
pythoscope crunchy.py

The call to run_crunchy is basically the normal starting point for Crunchy. What I was hoping to do was to generate unit tests for all modules being exercised, and not the main one as a simple run with no points-of-entry specified would do.
-----------

WARNING: Point of entry exited with error: TypeError('This Call already has a caller.',)
INFO: Generating tests for module crunchy.py.
INFO: Adding generated TestFindPort to tests/test_crunchy.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 "/Library/Frameworks/Python.framework/Versions/Current/bin/pythoscope", line 8, in <module>
    load_entry_point('pythoscope==0.3.2', 'console_scripts', 'pythoscope')()
  File "/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/pythoscope-0.3.2-py2.5.egg/pythoscope/__init__.py", line 176, in main
    generate_tests(args, force, template)
  File "/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/pythoscope-0.3.2-py2.5.egg/pythoscope/__init__.py", line 105, in generate_tests
    add_tests_to_project(project, modules, template, force)
  File "/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/pythoscope-0.3.2-py2.5.egg/pythoscope/generator/__init__.py", line 658, in add_tests_to_project
    generator.add_tests_to_project(project, modnames, force)
  File "/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/pythoscope-0.3.2-py2.5.egg/pythoscope/generator/__init__.py", line 419, in add_tests_to_project
    self._add_tests_for_module(module, project, force)
  File "/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/pythoscope-0.3.2-py2.5.egg/pythoscope/generator/__init__.py", line 451, in _add_tests_for_module
    for test_case in self._generate_test_cases(module):
  File "/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/pythoscope-0.3.2-py2.5.egg/pythoscope/generator/__init__.py", line 456, in _generate_test_cases
    test_case = self._generate_test_case(object, module)
  File "/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/pythoscope-0.3.2-py2.5.egg/pythoscope/generator/__init__.py", line 462, in _generate_test_case
    method_descriptions = sorted_test_method_descriptions(self._generate_test_method_descriptions(object, module))
  File "/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/pythoscope-0.3.2-py2.5.egg/pythoscope/generator/__init__.py", line 317, in sorted_test_method_descriptions
    return sorted(descriptions, key=lambda md: md.name)
  File "/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/pythoscope-0.3.2-py2.5.egg/pythoscope/generator/__init__.py", line 521, in _method_descriptions_from_function
    name = call2testname(call, function.name)
  File "/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/pythoscope-0.3.2-py2.5.egg/pythoscope/generator/__init__.py", line 314, in call2testname
    return objcall2testname(object_name, call.input, call.output)
  File "/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/pythoscope-0.3.2-py2.5.egg/pythoscope/generator/__init__.py", line 269, in objcall2testname
    call_description = "%s_for_%s" % (object2id(output), input_as_string(input))
  File "/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/site-packages/pythoscope-0.3.2-py2.5.egg/pythoscope/generator/__init__.py", line 221, in object2id
    raise TypeError("object2id() should be called with a ObjectWrapper argument, not %s" % object)
TypeError: object2id() should be called with a ObjectWrapper argument, not None

Related branches

Michal Kwiatkowski (ruby) wrote :

Confirming. Bug exists in current trunk, only the error message has changed a bit:

    TypeError: object2id() should be called with a SerializedObject argument, not None

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

Fixed in trunk r237.

Point of entry exits normally, spawning a browser that shows http://127.0.0.1:8001/index.html . Thank you for the bug report and let me know of any other problems.

Changed in pythoscope:
status: Confirmed → Fix Committed

On Thu, Nov 13, 2008 at 1:28 PM, Michal Kwiatkowski
<email address hidden> wrote:
> Fixed in trunk r237.
>
> Point of entry exits normally, spawning a browser that shows
> http://127.0.0.1:8001/index.html . Thank you for the bug report and let
> me know of any other problems.
>

Thanks!
André

> ** Changed in: pythoscope
> Status: Confirmed => Fix Committed
>
> --
> Internal Pythoscope error
> https://bugs.launchpad.net/bugs/295340
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Michal Kwiatkowski (ruby) wrote :

Fix released in pythoscope 0.4.

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