Title: doctest example code fails
Type: behaviour Severity: normal
Components: Documentation Versions: 2.5.1
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: JohnL, pjenvey
Priority: Keywords:

Created on 2011-02-03.04:25:49 by JohnL, last changed 2011-02-07.23:54:27 by pjenvey.

msg6379 (view) Author: John L (JohnL) Date: 2011-02-03.04:25:49
The doctest doc locate here:
shows example code such as:
if __name__ == "__main__":
    import doctest
This code fails with error message:
    TypeError: testmod() takes at least 1 argument (0 given)
My guess is that the correct code would read:
    import doctest, thismodule
provided, of course, that the example had been saved in the file
msg6384 (view) Author: Philip Jenvey (pjenvey) Date: 2011-02-07.23:54:26
I can't reproduce this. I'd suggest printing doctest.__file__ to ensure that it's being imported from where you think it is. The doctest module that ships with jython doesn't require 1 argument
Date User Action Args
2011-02-07 23:54:27pjenveysetstatus: open -> closed
resolution: invalid
messages: + msg6384
nosy: + pjenvey
2011-02-03 04:25:49JohnLcreate