summaryrefslogtreecommitdiffstats
path: root/Lib/test/json_tests/test_separators.py
diff options
context:
space:
mode:
authorEzio Melotti <none@none>2011-05-14 03:47:51 (GMT)
committerEzio Melotti <none@none>2011-05-14 03:47:51 (GMT)
commit6b60fb9148738de1525bbf5c7ddadc16a474c635 (patch)
treee720267d24b84f52de329af4415057e9335917e4 /Lib/test/json_tests/test_separators.py
parent3659f27ad37f992fadc1692137edf32c01c5bc66 (diff)
downloadcpython-6b60fb9148738de1525bbf5c7ddadc16a474c635.zip
cpython-6b60fb9148738de1525bbf5c7ddadc16a474c635.tar.gz
cpython-6b60fb9148738de1525bbf5c7ddadc16a474c635.tar.bz2
#5723: merge with 3.1.
Diffstat (limited to 'Lib/test/json_tests/test_separators.py')
-rw-r--r--Lib/test/json_tests/test_separators.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/Lib/test/json_tests/test_separators.py b/Lib/test/json_tests/test_separators.py
index d5b92bd..a01b38c 100644
--- a/Lib/test/json_tests/test_separators.py
+++ b/Lib/test/json_tests/test_separators.py
@@ -1,10 +1,8 @@
import textwrap
-from unittest import TestCase
+from test.json_tests import PyTest, CTest
-import json
-
-class TestSeparators(TestCase):
+class TestSeparators:
def test_separators(self):
h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh', 'i-vhbjkhnth',
{'nifty': 87}, {'field': 'yes', 'morefield': False} ]
@@ -31,12 +29,16 @@ class TestSeparators(TestCase):
]""")
- d1 = json.dumps(h)
- d2 = json.dumps(h, indent=2, sort_keys=True, separators=(' ,', ' : '))
+ d1 = self.dumps(h)
+ d2 = self.dumps(h, indent=2, sort_keys=True, separators=(' ,', ' : '))
- h1 = json.loads(d1)
- h2 = json.loads(d2)
+ h1 = self.loads(d1)
+ h2 = self.loads(d2)
self.assertEqual(h1, h)
self.assertEqual(h2, h)
self.assertEqual(d2, expect)
+
+
+class TestPySeparators(TestSeparators, PyTest): pass
+class TestCSeparators(TestSeparators, CTest): pass