doctest annoyance/puzzle

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sun Sep 5 19:06:29 EDT 2010


On 2010年9月05日 18:41:15 +0200, Stefan Schwarzer wrote:
> Hi Steven,
>> On 2010年09月05日 17:30, Steven D'Aprano wrote:
>> I run the doctests with:
>>>> python2.6 -m doctest examples.txt
>>>> and the first example passes, but the second fails with NameError:
>> make_spam not defined.
>> I run my doctests by calling
>> doctest.testfile(filename)
>> for each file in a loop. This way, names and their associated objects
> survice from one code block to the next.

That's fine if you're calling it from Python, but I want a way to run the 
tests from the shell, and the advertised way to do that is by calling 
doctest.py as a script. The module calls testfile, so it should work.
And now it's working for me. I have *no idea* what happened there... it 
wasn't working for me before, and now it is.
Sorry for the noise :(
-- 
Steven


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /