summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_json/test_speedups.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_json/test_speedups.py')
-rw-r--r--Lib/test/test_json/test_speedups.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_json/test_speedups.py b/Lib/test/test_json/test_speedups.py
index 8d98ab5..56f1882 100644
--- a/Lib/test/test_json/test_speedups.py
+++ b/Lib/test/test_json/test_speedups.py
@@ -44,3 +44,7 @@ class TestEncode(CTest):
self.assertRaises(ZeroDivisionError, test, 'check_circular')
self.assertRaises(ZeroDivisionError, test, 'allow_nan')
self.assertRaises(ZeroDivisionError, test, 'sort_keys')
+
+ def test_unsortable_keys(self):
+ with self.assertRaises(TypeError):
+ self.json.encoder.JSONEncoder(sort_keys=True).encode({'a': 1, 1: 'a'})