Some corrections, to highlight the depth of my confusion...
On Nov 11, 2008, at 9:10 PM, Joe Strout wrote:
Actually, it does not.
And no, it isn't; it's the NAME of the module the function is in. I'm
not sure what good that does me. docstring.testm od does take an
optional "name" parameter, but the documentation (at least in 2.5.2)
does not explain what this parameter is used for. I tried using it
thusly:
doctest.testmod (name=_test.__m odule__)
but that didn't work; it appears to still be testing the __main__
module. (Perhaps the name parameter is only used to describe the
module in the output, in which case, all I've accomplished here is
getting doctest to lie.)
This question remains open. :)
Thanks,
- Joe
On Nov 11, 2008, at 9:10 PM, Joe Strout wrote:
doctest.testmod (mymodule)
>
This actually works fine if I'm importing the module (with the
standard name) somewhere else
>
This actually works fine if I'm importing the module (with the
standard name) somewhere else
I noticed that a function object has a __module__ attribute, that is
a reference to the module the function is in.
a reference to the module the function is in.
not sure what good that does me. docstring.testm od does take an
optional "name" parameter, but the documentation (at least in 2.5.2)
does not explain what this parameter is used for. I tried using it
thusly:
doctest.testmod (name=_test.__m odule__)
but that didn't work; it appears to still be testing the __main__
module. (Perhaps the name parameter is only used to describe the
module in the output, in which case, all I've accomplished here is
getting doctest to lie.)
I'm sure there is a magic identifier somewhere that lets a code get
a reference to its own module, but I haven't been able to find it.
Can someone share a clue?
a reference to its own module, but I haven't been able to find it.
Can someone share a clue?
Thanks,
- Joe
Comment