Helllo, I'm seeing a strange issue when running unittests on python3.3 and
python3.4 that somehow involves matplotlib.  My code has a somewhat
complicated setup, but I think I've boiled the issue down to the following
reproduction steps


import unittest
import warnings

import matplotlib.pyplot

class TestMe(unittest.TestCase):
    def test_warn(self):
        with self.assertWarns(UserWarning):
            warnings.warn("a warning", UserWarning)

if __name__ == "__main__":
    unittest.main()


It looks like it should pass, but it errors as follows

E
======================================================================
ERROR: test_warn (__main__.TestMe)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/homes/5/jevans/Downloads/testit.py", line 8, in test_warn
    with self.assertWarns(UserWarning):
  File
"/space/getafix/1/users/jevans/anaconda/envs/py3k/lib/python3.3/unittest/case.py",
line 177, in __enter__
    for v in sys.modules.values():
RuntimeError: dictionary changed size during iteration

----------------------------------------------------------------------
Ran 1 test in 0.002


If the matplotlib import is changed to just

import matlotlib

or if the matplotlib import is commented out altogether, it then passes.
 I'm seeing the behavior on Anaconda with python 3.3 and matplotlib 1.3.1
on both mac and linux, but also with MacPorts with pythons 3.3 and 3.4,
matplotlib 1.3.1.  All seems fine with a  Fedora 20 laptop with python 3.3
and also matplotlib 1.3.1.


-- 
John Evans
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to