summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2017-10-07 20:52:57 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-10-07 20:52:57 (GMT)
commitcae6e4775b37c412609d3a0d303c0831ff0012ff (patch)
treee7c378856d413e60b857067115da9370eefaa792 /Lib/test
parent5f396dba1d11356ab18e3bec130596197e741a64 (diff)
downloadcpython-cae6e4775b37c412609d3a0d303c0831ff0012ff.zip
cpython-cae6e4775b37c412609d3a0d303c0831ff0012ff.tar.gz
cpython-cae6e4775b37c412609d3a0d303c0831ff0012ff.tar.bz2
[3.6] bpo-31655: Validate keyword names in SimpleNamespace constructor. (GH-3909) (#3920)
(cherry picked from commit 79ba471488b936abda5ba5234b1ea90cbc94cae6)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_types.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py
index d79429f..73fbdbf 100644
--- a/Lib/test/test_types.py
+++ b/Lib/test/test_types.py
@@ -1051,6 +1051,8 @@ class SimpleNamespaceTests(unittest.TestCase):
with self.assertRaises(TypeError):
types.SimpleNamespace(1, 2, 3)
+ with self.assertRaises(TypeError):
+ types.SimpleNamespace(**{1: 2})
self.assertEqual(len(ns1.__dict__), 0)
self.assertEqual(vars(ns1), {})