Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test_deepreload breaks pylab irunner tests #1636

Closed
jenshnielsen opened this issue Apr 20, 2012 · 2 comments · Fixed by #1645
Closed

Test_deepreload breaks pylab irunner tests #1636

jenshnielsen opened this issue Apr 20, 2012 · 2 comments · Fixed by #1645
Milestone

Comments

@jenshnielsen
Copy link
Contributor

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)
@fperez
Copy link
Member

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.

@takluyver
Copy link
Member

We are seeing the Mac buildbot fail on this:

https://jenkins.shiningpanda.com/ipython/job/ipython-mac/82/testReport/

@fperez fperez closed this as completed in 9b5abe1 Apr 23, 2012
arokem pushed a commit to arokem/ipython that referenced this issue Apr 23, 2012
Exclude UserDict when deep reloading NumPy.

Closes ipython#1636.
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
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 ipython#1636.
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Exclude UserDict when deep reloading NumPy.

Closes ipython#1636.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants