lame question

32 views
Skip to first unread message

Атомный Медведь

unread,
Mar 15, 2016, 10:14:36 AM3/15/16
to Pythoscope
I'm a newbie admiring Pythoscope user (and, frankly speaking, newbie coder).

Currently I'm facing following issue.
I wrote poe for method (say, Kitten.meow()) of some class (say, Kitten). The method Kitten.meow() involves creating an instance of other class. When generating tests, Pythoscope says that something wrong happened (ERROR: Oops, it seems that an internal Pythoscope error occured). At the same time, Pythoscope without problem creates tests for other Kitten methods (which does not involve creating instances of other classes).

Can more hard boiled guys pls give me a clue?
Message has been deleted

sste...@gmail.com

unread,
Mar 15, 2016, 10:50:30 AM3/15/16
to pytho...@googlegroups.com
Clue: show code you're having trouble with; complete, runnable example with output.

S

On Mar 15, 2016, at 9:30 AM, Атомный Медведь wrote:

I'm a newbie admiring Pythoscope user (and, frankly speaking, newbie python coder).

Currently I'm facing following issue. I wrote poe to test some method (say Kitten.meow()) of class Kitten. The Kitten.meow() creates an instance of other class, and when I'm trying to generate tests, Pythoscope says that something wrong happened (ERROR: Oops, it seems that an internal Pythoscope error occured).
At the same time, Pythoscope tests rest of Kitten methods which do not involve other classes without complaining.

Can you please give me a clue?

--
You received this message because you are subscribed to the Google Groups "Pythoscope" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythoscope+...@googlegroups.com.
To post to this group, send email to pytho...@googlegroups.com.
Visit this group at https://groups.google.com/group/pythoscope.
For more options, visit https://groups.google.com/d/optout.

Атомный Медведь

unread,
Mar 15, 2016, 11:25:30 AM3/15/16
to Pythoscope
ok, here's problem poe contents:

# .pythoscope/points-of-entry/meow_poe.py

import sys
sys.path.insert(0, '../..')
from __init__ import Kitten

Kitten().meow()

The Kitten().meow() method itself:

# kitten.py

from fleet_connector import FleetConnector as fcon

class Kitten:
    def meow(self):
        fc = fcon(self.fc_ip, self.fc_port)
        return fc.get()
    
Pythoscope's output:

bla-bla-bla

'OrderedDict' object has no attribute '_OrderedDict__root'

WARNING: Point of entry exited with error: SystemExit("Unable to connect to docker: 'NoneType' object has no attribute 'containers'",)

INFO: Generating tests for module kitten.py.

ERROR: Oops, it seems that an internal Pythoscope error occurred. Please file a bug report at https://bugs.launchpad.net/pythoscope


Traceback (most recent call last):

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/bin/pythoscope", line 11, in <module>

    sys.exit(main())

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/__init__.py", line 190, in main

    generate_tests(args, force, template)

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/__init__.py", line 119, in generate_tests

    add_tests_to_project(project, modules, template, force)

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 985, in add_tests_to_project

    generator.add_tests_to_project(project, modnames, force)

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 705, in add_tests_to_project

    self._add_tests_for_module(module, project, force)

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 720, in _add_tests_for_module

    for test_case in self._generate_test_cases(module):

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 725, in _generate_test_cases

    test_case = self._generate_test_case(object, module)

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 731, in _generate_test_case

    method_descriptions = resolve_name_duplicates(sorted_test_method_descriptions(self._generate_test_method_descriptions(object, module)))

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 546, in sorted_test_method_descriptions

    return sorted(descriptions, key=lambda md: md.name)

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 798, in _generate_test_method_descriptions_for_class

    yield self._method_description_from_user_object(user_object)

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 832, in _method_description_from_user_object

    assigned_names = assign_names_for(user_object)

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 398, in assign_names_for

    return assign_names_to_objects(objects_worth_naming(get_objects_usage_counts(context)))

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 329, in get_objects_usage_counts

    return dict(counted(get_contained_objects(context)))

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 305, in get_contained_objects

    return get_contained_objects(calls)

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 291, in get_contained_objects

    return flatten(map(get_contained_objects, obj))

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 311, in get_contained_objects

    return get_those_and_contained_objects(obj.input.values() + [output])

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 322, in get_those_and_contained_objects

    return objs + get_contained_objects(objs)

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 291, in get_contained_objects

    return flatten(map(get_contained_objects, obj))

  File "/Users/mxm/Yandex.Disk.localized/Virtualenvs/nct-support/lib/python2.7/site-packages/pythoscope/generator/__init__.py", line 315, in get_contained_objects

    raise TypeError("Wrong argument to get_contained_objects: %r." % obj)

TypeError: Wrong argument to get_contained_objects: None.


Mister ssteinerX, sir, do you have another clue for me?



вторник, 15 марта 2016 г., 17:50:30 UTC+3 пользователь ssteinerX написал:

Michał Kwiatkowski

unread,
Mar 18, 2016, 9:40:18 AM3/18/16
to Pythoscope
Hi!

It seems to be a bug in pythoscope, related in particular to whatever FleetConnector does. I tried your example with a blank FleetConnector definition like that:

class FleetConnector:
    def __init__(self, ip, port):
        pass
    def get(self):
        pass

and it worked OK. I'm guessing fleet_connector is a third-party module, possibly written in C and Pythoscope has a limited support for those.
Reply all
Reply to author
Forward
0 new messages