Issue1703

classification
Title: doctest example code fails
Type: behaviour Severity: normal
Components: Documentation Versions: 2.5.1
process
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.

Messages
msg6379 (view) Author: John L (JohnL) Date: 2011-02-03.04:25:49
The doctest doc locate here:
http://www.jython.org/docs/library/doctest.html
shows example code such as:
if __name__ == "__main__":
    import doctest
    doctest.testmod()
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
    doctest.testmod(thismodule)
provided, of course, that the example had been saved in the file thismodule.py
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
History
Date User Action Args
2011-02-07 23:54:27pjenveysetstatus: open -> closed
resolution: invalid
messages: + msg6384
nosy: + pjenvey
2011-02-03 04:25:49JohnLcreate