On Sun, 07 Sep 2008 15:51:01 +0200, Fredrik Lundh wrote: > Steven D'Aprano wrote: > >> I have a function in my module: >> >> def selftest(verbose=False): >> import doctest >> doctest.testmod(verbose=verbose) > > what happens if you change the above to > > def selftest(verbose=False): > import doctest, yourmodule > doctest.testmod(yourmodule, verbose=verbose) > > (where yourmodule is the name of your module, obviously)
Well, that certainly fixed the problem, thanks. It now correctly runs all my doctests. But I don't understand why a bare doctest.testmod() works when you run it non-interactively, but fails when run interactively. -- Steven -- http://mail.python.org/mailman/listinfo/python-list