diff --git a/IPython/utils/tests/test_wildcard.py b/IPython/utils/tests/test_wildcard.py index 20d459b..7c5cff5 100644 --- a/IPython/utils/tests/test_wildcard.py +++ b/IPython/utils/tests/test_wildcard.py @@ -131,3 +131,18 @@ class Tests (unittest.TestCase): show_all=True).keys() a.sort() self.assertEqual(a, res) + + def test_dict_dir(self): + class A(object): + def __init__(self): + self.a = 1 + self.b = 2 + def __getattribute__(self, name): + if name=="a": + raise AttributeError + return object.__getattribute__(self, name) + + a = A() + adict = wildcard.dict_dir(a) + assert "a" not in adict # change to assertNotIn method in >= 2.7 + self.assertEqual(adict["b"], 2)