summaryrefslogtreecommitdiff
path: root/Lib/json/tests/test_separators.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/json/tests/test_separators.py')
-rw-r--r--Lib/json/tests/test_separators.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/Lib/json/tests/test_separators.py b/Lib/json/tests/test_separators.py
index d5b92bd65d..a4246e1f2d 100644
--- a/Lib/json/tests/test_separators.py
+++ b/Lib/json/tests/test_separators.py
@@ -1,10 +1,8 @@
import textwrap
-from unittest import TestCase
+from json.tests import PyTest, CTest
-import json
-
-class TestSeparators(TestCase):
+class TestSeparators(object):
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