summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dict.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_dict.py')
-rw-r--r--Lib/test/test_dict.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index cd396c8..cdd8b6c 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -879,6 +879,16 @@ class DictTest(unittest.TestCase):
values = list(it) + [drop]
self.assertEqual(sorted(values), sorted(list(data.values())))
+ def test_instance_dict_getattr_str_subclass(self):
+ class Foo:
+ def __init__(self, msg):
+ self.msg = msg
+ f = Foo('123')
+ class _str(str):
+ pass
+ self.assertEqual(f.msg, getattr(f, _str('msg')))
+ self.assertEqual(f.msg, f.__dict__[_str('msg')])
+
from test import mapping_tests
class GeneralMappingTests(mapping_tests.BasicTestMappingProtocol):