summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_types.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py
index 3f5ac98..3ee4c6b 100644
--- a/Lib/test/test_types.py
+++ b/Lib/test/test_types.py
@@ -1135,6 +1135,15 @@ class SimpleNamespaceTests(unittest.TestCase):
with self.assertRaises(TypeError):
ns['spam']
+ def test_subclass(self):
+ class Spam(types.SimpleNamespace):
+ pass
+
+ spam = Spam(ham=8, eggs=9)
+
+ self.assertIs(type(spam), Spam)
+ self.assertEqual(vars(spam), {'ham': 8, 'eggs': 9})
+
def test_main():
run_unittest(TypesTests, MappingProxyTests, ClassCreationTests,