diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-10-31 03:51:03 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-10-31 03:51:03 (GMT) |
commit | 8afa7fa51064848d826e4eb8a2bd46cf7f730b0f (patch) | |
tree | ef0fb644e04cbf28714579ef0985a1cd9d951354 /Lib/test/test_descr.py | |
parent | e8ea97fffb591cd71090d0f3114bf1d3bcd31454 (diff) | |
download | cpython-8afa7fa51064848d826e4eb8a2bd46cf7f730b0f.zip cpython-8afa7fa51064848d826e4eb8a2bd46cf7f730b0f.tar.gz cpython-8afa7fa51064848d826e4eb8a2bd46cf7f730b0f.tar.bz2 |
don't shadow the __qualname__ descriptor with __qualname__ in the class's __dict__ (closes #16271)
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r-- | Lib/test/test_descr.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 079f60b..21c7b8c 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -4506,7 +4506,7 @@ order (MRO) for bases """ ns = {'__qualname__': 'some.name'} tp = type('Foo', (), ns) self.assertEqual(tp.__qualname__, 'some.name') - self.assertEqual(tp.__dict__['__qualname__'], 'some.name') + self.assertNotIn('__qualname__', tp.__dict__) self.assertEqual(ns, {'__qualname__': 'some.name'}) ns = {'__qualname__': 1} @@ -4564,7 +4564,7 @@ class DictProxyTests(unittest.TestCase): keys = list(it) keys.sort() self.assertEqual(keys, ['__dict__', '__doc__', '__module__', - '__qualname__', '__weakref__', 'meth']) + '__weakref__', 'meth']) @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(), 'trace function introduces __local__') @@ -4573,7 +4573,7 @@ class DictProxyTests(unittest.TestCase): it = self.C.__dict__.values() self.assertNotIsInstance(it, list) values = list(it) - self.assertEqual(len(values), 6) + self.assertEqual(len(values), 5) @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(), 'trace function introduces __local__') @@ -4584,7 +4584,7 @@ class DictProxyTests(unittest.TestCase): keys = [item[0] for item in it] keys.sort() self.assertEqual(keys, ['__dict__', '__doc__', '__module__', - '__qualname__', '__weakref__', 'meth']) + '__weakref__', 'meth']) def test_dict_type_with_metaclass(self): # Testing type of __dict__ when metaclass set... |