[issue6835] doctest problem with decorated function when decorator is defined in separate file

2018-12-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Problem with doctest and decorated functions

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6835] doctest problem with decorated function when decorator is defined in separate file

2012-11-30 Thread Bruno Dupuis

Bruno Dupuis added the comment:

updated the test to 3k (requires sh and Python2.{6,7} as python2). It works. 
Anyone to close?

--
nosy: +ezio.melotti, michael.foord
Added file: http://bugs.python.org/file28162/mytest3k.sh

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6835
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6835] doctest problem with decorated function when decorator is defined in separate file

2012-11-30 Thread Bruno Dupuis

Bruno Dupuis added the comment:

it's a duplicate of #1108

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6835
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6835] doctest problem with decorated function when decorator is defined in separate file

2012-11-29 Thread Bruno Dupuis

Changes by Bruno Dupuis bdup...@lisael.org:


--
nosy: +bruno.dupuis

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6835
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6835] doctest problem with decorated function when decorator is defined in separate file

2010-07-11 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
stage:  - needs patch
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6835
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6835] doctest problem with decorated function when decorator is defined in separate file

2009-09-03 Thread Goetz Pfeiffer

New submission from Goetz Pfeiffer goet...@googlemail.com:

As described in bug 1108, doctest skips tests on 
functions that have been decorated with a decorator that 
is defined in a separate file.

As described in bug 1108, the problem lies in 
file doctest.py, there in class DocTestFinder,
there in method _from_module

There at about line 857 the following code makes problems:

elif inspect.isfunction(object):
return module.__dict__ is object.func_globals

The func_globals property of the function is used to find out if
the function was defined in the current module. This is not true
for a decorated function where the decorator is defined in another
module. Maybe _from_module() should use inspect.getmodulename() or
the __module__ property of the function instead. __module__
is set correctly when the decorator uses functools.wraps().

The func_globals property is read-only, so there is no chance fix this
at the decorator definition.

--
components: Library (Lib)
files: mytest.sh
messages: 92212
nosy: goetzpf
severity: normal
status: open
title: doctest problem with decorated function when decorator is defined in 
separate file
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file14826/mytest.sh

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6835
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com