def test_bad_cache_setter(self): emsg = ("Require cache to be a 'WeakValueDictionary', " "got 'dict'") with self.assertRaisesRegexp(TypeError, emsg): self.plot.cache = dict()