[Python-Dev] doctest and inspect.getmodule (original) (raw)

Johannes Gijsbers jlgijsbers at planet.nl
Sat Sep 11 18:26:51 CEST 2004


I just checked in a change to inspect.getmodule (without running the tests beforehand, not a smart move) which broke a whole bunc of tests for doctest. The tests mostly seem to fail because doctest can find modules for objects it previously couldn't.

I think the change is basically correct, but I'm not sure how to fix doctest. Should doctest omit the module, or should the doctest tests be changed to expect the module being printed?

Oh, I promise I'll run the tests before checking in next time.

Johannes

P.S.: here's the checkin message for the change:

Modified Files: inspect.py Log Message: Use module attribute when available instead of using isclass() predicate (functions and methods have grown the module attribute too). See bug #570300.

Index: inspect.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/inspect.py,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- inspect.py 18 Aug 2004 12:40:30 -0000 1.54 +++ inspect.py 11 Sep 2004 15:53:22 -0000 1.55 @@ -370,7 +370,7 @@ """Return the module an object was defined in, or None if not found.""" if ismodule(object): return object



More information about the Python-Dev mailing list