[IPython-dev] correct test-suite

Fernando Perez fperez.net@gmail....
Tue Jul 27 01:40:16 CDT 2010


Hi,

On Mon, Jul 26, 2010 at 11:25 PM, Thomas Spura
<tomspur@fedoraproject.org> wrote:
> Some are failing, because of a deprecation warning in argparse (it
> seems ipython imports my local installed one, and not the bundled one).
> Updating the bundled one first and then fix the deprecation warning
> would help quite a lot.

Yes, I'll try to update argparse to the version in 2.7 official, as it
will move us in the direction of less bundled utilities.

> Here is the output:
>
> $ /usr/bin/python /usr/lib/python2.6/site-packages/IPython/testing/iptest.py
> IPython.core IPython.extensions
> EEEEE.EEEEEEEE.................EE........................E.E.........E...SE....EEEE...FEFE.E.
> ======================================================================
> ERROR: Failure: ImportError (cannot import name release)
> ----------------------------------------------------------------------
> Traceback (most recent call last): File
> "/usr/lib/python2.6/site-packages/nose/loader.py", line 382, in
> loadTestsFromName addr.filename, addr.module) File
> "/usr/lib/python2.6/site-packages/nose/importer.py", line 39, in
> importFromPath return self.importFromDir(dir_path, fqname) File
> "/usr/lib/python2.6/site-packages/nose/importer.py", line 84, in
> importFromDir mod = load_module(part_fqname, fh, filename, desc) File
> "/home/tom/programming/repositories/github/ipython.git/IPython/core/application.py",
> line 35, in <module> from IPython.core import release, crashhandler
> ImportError: cannot import name release
>
> ======================================================================
> ERROR: Failure: AttributeError ('module' object has no attribute
> 'utils')
> ----------------------------------------------------------------------
> Traceback (most recent call last): File
> "/usr/lib/python2.6/site-packages/nose/loader.py", line 382, in
> loadTestsFromName addr.filename, addr.module) File
> "/usr/lib/python2.6/site-packages/nose/importer.py", line 39, in
> importFromPath return self.importFromDir(dir_path, fqname) File
> "/usr/lib/python2.6/site-packages/nose/importer.py", line 84, in
> importFromDir mod = load_module(part_fqname, fh, filename, desc) File
> "/home/tom/programming/repositories/github/ipython.git/IPython/core/completer.py",
> line 85, in <module> import IPython.utils.rlineimpl as readline
> AttributeError: 'module' object has no attribute 'utils'
>
> ======================================================================
> ERROR: Failure: ImportError (cannot import name ultratb)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File "/usr/lib/python2.6/site-packages/nose/loader.py", line 382, in
> loadTestsFromName addr.filename, addr.module)
>  File "/usr/lib/python2.6/site-packages/nose/importer.py", line 39, in
> importFromPath return self.importFromDir(dir_path, fqname)
>  File "/usr/lib/python2.6/site-packages/nose/importer.py", line 84, in
> importFromDir mod = load_module(part_fqname, fh, filename, desc)
>  File
> "/home/tom/programming/repositories/github/ipython.git/IPython/core/crashhandler.py",
> line 26, in <module> from IPython.core import ultratb ImportError:
> cannot import name ultratb
>

...

All of this seems to indicate that you are somehow mixing an old,
0.10.x tree with the tests for the current code.  In 0.11.x we
reorganized the big code dump from the original ipython into a more
rational structure, but your tests can't seem to find *any* imports.
That seems to indicate that you are finding on your PYTHONPATH the old
code first.

Try this and let us know what you get (from a plain python shell):

>>> import IPython
>>> print IPython.__version__
0.11.alpha1.git
>>> print IPython.__file__
/home/fperez/usr/lib/python2.6/site-packages/IPython/__init__.pyc


Also, looking at which one of these imports work will be a good
tell-tale sign (from a normal python shell).  If you have the real
0.11 tree, you should get:

>>> import IPython.core.ultratb
>>> import IPython.ultraTB
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named ultraTB


whereas a 0.10.x tree gives the opposite:

>>> import IPython.ultraTB
>>> import IPython.core.ultratb
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named core.ultratb


Cheers,

f


More information about the IPython-dev mailing list