Goto source troubles with doctests in __test__

View: New views
5 Messages — Rating Filter:   Alert me  

Goto source troubles with doctests in __test__

by René Pijlman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In the testing tool, when I right-click on a doctest in __test__ and do
Goto Source, I get an error dialog: "Error executing
command.internal.none.goto_defn".

There's another problem when the name of an item in __test__ equals the
name of a function definition in the same file. See the code below. When
I right-click on foo.py > __test__ > foo in the tree in the testing tool
and Goto Source, Wing highlights the function definition of foo(),
rather than __test__['foo'].

I'm using Wing 3.1.1-1 (rev 18164) on Windows XP. This is the code I
used to reproduce the issue (both tests fail):

#!/usr/bin/python

__test__ = {}

def foo():
     '''
     >>> foo()
     'bar'
     '''
     return 'foo'

__test__['foo'] = '''
 >>> foo()
'bar'
'''

def _test():
     import doctest
     doctest.testmod()

if __name__ == "__main__":
     _test()

--
René
http://www.applinet.nl
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide

Re: Goto source troubles with doctests in __test__

by Wingware Support :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

René Pijlman wrote:
> In the testing tool, when I right-click on a doctest in __test__ and do
> Goto Source, I get an error dialog: "Error executing
> command.internal.none.goto_defn".
>
> There's another problem when the name of an item in __test__ equals the
> name of a function definition in the same file. See the code below. When
> I right-click on foo.py > __test__ > foo in the tree in the testing tool
> and Goto Source, Wing highlights the function definition of foo(),
> rather than __test__['foo'].

Thanks for the report.  I'm going to let John handle this since he's been
doing all the work on the doctest support, but he is on vacation until
next week.

--

Stephan Deibel
Wingware | Python IDE
Advancing Software Development

www.wingware.com

_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide

Re: Goto source troubles with doctests in __test__

by René Pijlman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Wingware Support wrote:
> René Pijlman wrote:
>> In the testing tool, when I right-click on a doctest in __test__ and
>> do Goto Source, I get an error dialog: "Error executing
>> command.internal.none.goto_defn".
>
> Thanks for the report.  I'm going to let John handle this since he's been
> doing all the work on the doctest support, but he is on vacation until
> next week.

Just checking because it's been a while ... has John noticed this issue?

--
René
http://www.applinet.nl
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide

Re: Goto source troubles with doctests in __test__

by Wingware Support :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

René Pijlman wrote:

> Wingware Support wrote:
>> René Pijlman wrote:
>>> In the testing tool, when I right-click on a doctest in __test__ and
>>> do Goto Source, I get an error dialog: "Error executing
>>> command.internal.none.goto_defn".
>>
>> Thanks for the report.  I'm going to let John handle this since he's been
>> doing all the work on the doctest support, but he is on vacation until
>> next week.
>
> Just checking because it's been a while ... has John noticed this issue?

I've made some improvements to goto source for tests in __test__.  It
still doesn't work as well as goto source does for tests defined by
classes and def's because it's more difficult to determine where an
object in a dictionary came from.

Thanks for the bug report.

Cheers,

John
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide

Re: Goto source troubles with doctests in __test__

by René Pijlman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Wingware Support wrote:
> I've made some improvements to goto source for tests in __test__.  It
> still doesn't work as well as goto source does for tests defined by
> classes and def's because it's more difficult to determine where an
> object in a dictionary came from.

Okay, thanks.

--
René
_________________________________________________
Wing IDE users list
http://wingware.com/lists/wingide
LightInTheBox - Buy quality products at wholesale price