[py-dev] Odd import issue with tests for compatibility modules.
holger krekel
hpk at trillke.net
Thu Jun 16 14:12:28 CEST 2005
On Thu, Jun 16, 2005 at 06:43 -0400, David Stanek wrote:
> On Wed, Jun 15, 2005 at 12:40:33PM -0500, Ian Bicking wrote:
> > Would it make sense to force the import, like:
> >
> > from py.compat import doctest
> > sys.modules['doctest'] = doctest
> >
> > ? Maybe you're already doing this, but I wasn't sure.
> >
> > --
> > Ian Bicking / ianb at colorstudy.com / http://blog.ianbicking.org
>
> I am already doing that in py/compat/testing/test_doctest.py. The
> problem is that py/compat/testing/test_doctest2.py had a function
> named test_mail() that currently does a 'from test import
> test_doctest2', which essentially is importing itself from the
> Python tests. That is the import that seems to be giving me trouble.
I have checked in some help for getting this to work (see the
commit message). Generally, it's a bit messy because and we
may want to modify the tests some more to not use test_support for
example but i don't know yet.
The immediate problem is a different one, as one can't
currently do
from py.compat.doctest import *
which - i think - you pointed out earlier already. For this
the initpkg() function in initpkg.py needs to be enhanced
or special-cased, i guess.
holger
More information about the py-dev
mailing list