summaryrefslogtreecommitdiffstats
path: root/Lib/json
diff options
context:
space:
mode:
authorDoug Hellmann <doug.hellmann@gmail.com>2010-07-21 12:35:38 (GMT)
committerDoug Hellmann <doug.hellmann@gmail.com>2010-07-21 12:35:38 (GMT)
commit76e57947a10466654f09b696886eae5ff245e550 (patch)
tree850b6cbcb71693b8f3e4d2c50c8228991f4ff425 /Lib/json
parentb034c75495cf033b3ec7a1b6ea6b1f4c1338ecb4 (diff)
downloadcpython-76e57947a10466654f09b696886eae5ff245e550.zip
cpython-76e57947a10466654f09b696886eae5ff245e550.tar.gz
cpython-76e57947a10466654f09b696886eae5ff245e550.tar.bz2
Merged revisions 83016 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83016 | doug.hellmann | 2010-07-21 08:29:04 -0400 (Wed, 21 Jul 2010) | 1 line Apply patch from Ray Allen for issue 9296 ........
Diffstat (limited to 'Lib/json')
-rw-r--r--Lib/json/tests/test_fail.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/json/tests/test_fail.py b/Lib/json/tests/test_fail.py
index 94e01e6..9768edf 100644
--- a/Lib/json/tests/test_fail.py
+++ b/Lib/json/tests/test_fail.py
@@ -74,3 +74,12 @@ class TestFail(TestCase):
pass
else:
self.fail("Expected failure for fail{0}.json: {1!r}".format(idx, doc))
+
+ def test_non_string_keys_dict(self):
+ data = {'a' : 1, (1, 2) : 2}
+
+ #This is for c encoder
+ self.assertRaises(TypeError, json.dumps, data)
+
+ #This is for python encoder
+ self.assertRaises(TypeError, json.dumps, data, indent=True)