[lxml-dev] could not find doctest

Stefan Behnel stefan_ml at behnel.de
Wed May 20 09:52:46 CEST 2009


Mary Lei wrote:
> I copied the following from the lxml document on the web:

... and you copied a bit too much.

> from lxml.html import usedoctest
>
> Traceback (most recent call last):
>    File "/home/lei/lxml-2.2/src/lxml/doctestcompare.py", line 486, in
> _find_doctest_frame
>      "Could not find doctest (only use this function *inside* a doctest)")
> LookupError: Could not find doctest (only use this function *inside* a
> doctest)

As the error message tells you, importing "usedoctest" will only work from
a doctest. Unless you are writing a doctest, there is no reason to use
that module.

Stefan



More information about the lxml-dev mailing list