Test_deepreload breaks pylab irunner tests #1636

Closed
jenshnielsen opened this Issue Apr 20, 2012 · 2 comments

Comments

Projects
None yet
3 participants
Contributor

jenshnielsen commented Apr 20, 2012

On master the two pylab_import_all tests are broken by the addition of test_deepreload.
Pylab_import_all still works as expected but the tests fail. This is tested on Ubuntu 11.10 and 12.04 using python 2.7 and the head of the mpl 1.1.x branch.

It results in the following error and an identical one for False. Note that the code works as expected when running
with irunner outside the testing env. Removing the test_deepreload.py file from the lib test dir also makes the pylab tests pass again.

======================================================================
ERROR: Verify that plot is available when pylab_import_all = True
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/IPython/testing/decorators.py", line 228, in skipper_func
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/IPython/testing/decorators.py", line 225, in skipper_func
    if skip_val():
  File "/usr/local/lib/python2.7/dist-packages/IPython/lib/tests/test_irunner_pylab_magic.py", line 21, in pylab_not_importable
    import pylab
  File "/usr/local/lib/python2.7/dist-packages/pylab.py", line 1, in <module>
    from matplotlib.pylab import *
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/pylab.py", line 221, in <module>
    from matplotlib import mpl  # pulls in most modules
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/mpl.py", line 1, in <module>
    from matplotlib import artist
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/artist.py", line 6, in <module>
    from transforms import Bbox, IdentityTransform, TransformedBbox, TransformedPath
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/transforms.py", line 45, in <module>
    from path import Path
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/path.py", line 18, in <module>
    class Path(object):
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/path.py", line 400, in Path
    _unit_regular_polygons = WeakValueDictionary()
  File "/usr/lib/python2.7/weakref.py", line 53, in __init__
    UserDict.UserDict.__init__(self, *args, **kw)
TypeError: unbound method __init__() must be called with UserDict instance as first argument (got WeakValueDictionary instance instead)
Owner

fperez commented Apr 21, 2012

Just confirming that I see the problem here too. We need to move the deepreload tests into their own group so they don't mess up anything else, since they muck around with numpy. We hadn't seen this as a failure in the build bot b/c it doesn't have numpy or matplotlib, so in reality it only runs a subset of the full test suite. But on a box with all dependencies I can confirm this.

Owner

takluyver commented Apr 21, 2012

fperez closed this in 9b5abe1 Apr 23, 2012

@arokem arokem pushed a commit to arokem/ipython that referenced this issue Apr 23, 2012

@fperez fperez Merge pull request #1645 from bfroehle/test_deepreload
Exclude UserDict when deep reloading NumPy.

Closes #1636.
e544c6d

@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014

@bfroehle bfroehle Exclude UserDict when deep reloading NumPy.
This prevents another test failure in IPython.lib.tests.test_irunner_pylab_magic::

    Traceback (most recent call last):
    ...
      File "/usr/lib/python2.7/weakref.py", line 53, in __init__
        UserDict.UserDict.__init__(self, *args, **kw)
    TypeError: unbound method __init__() must be called with UserDict instance as first argument (got WeakValueDictionary instance instead)

Closes #1636.
612d3b8

@mattvonrocketstein mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014

@fperez fperez Merge pull request #1645 from bfroehle/test_deepreload
Exclude UserDict when deep reloading NumPy.

Closes #1636.
fb17335
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment