[issue9315] The trace module lacks unit tests

Alexander Belopolsky report at bugs.python.org
Wed Jul 28 05:28:20 CEST 2010


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

I am attaching a patch, issue9315-trace-fix.diff, that fixes a py3k bug exposed by issue9315.1-py3k.patch tests.

One of the 3.x changes that caused the failure was that frames now have a __doc__ attribute and cannot be distinguished from functions.  I replaced the hasattr(f, "__doc__") with hasattr(f, "__annotations__"), but I wonder if it would be better to use something like isinstance(f, types.FunctionType) there.

Eli, in order to test the trace module more thoroughly, you need to add generators, list and set comprehensions and instance, class, and static methods to your fake module and test tracing of their execution.

----------
Added file: http://bugs.python.org/file18226/issue9315-trace-fix.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9315>
_______________________________________


More information about the Python-bugs-list mailing list