summaryrefslogtreecommitdiff
path: root/Lib/json/tests/test_fail.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/json/tests/test_fail.py')
-rw-r--r--Lib/json/tests/test_fail.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/Lib/json/tests/test_fail.py b/Lib/json/tests/test_fail.py
index dd9ec4137e..ae962c88a4 100644
--- a/Lib/json/tests/test_fail.py
+++ b/Lib/json/tests/test_fail.py
@@ -1,6 +1,4 @@
-from unittest import TestCase
-
-import json
+from json.tests import PyTest, CTest
# Fri Dec 30 18:57:26 2005
JSONDOCS = [
@@ -61,15 +59,15 @@ SKIPS = {
18: "spec doesn't specify any nesting limitations",
}
-class TestFail(TestCase):
+class TestFail(object):
def test_failures(self):
for idx, doc in enumerate(JSONDOCS):
idx = idx + 1
if idx in SKIPS:
- json.loads(doc)
+ self.loads(doc)
continue
try:
- json.loads(doc)
+ self.loads(doc)
except ValueError:
pass
else:
@@ -79,7 +77,11 @@ class TestFail(TestCase):
data = {'a' : 1, (1, 2) : 2}
#This is for c encoder
- self.assertRaises(TypeError, json.dumps, data)
+ self.assertRaises(TypeError, self.dumps, data)
#This is for python encoder
- self.assertRaises(TypeError, json.dumps, data, indent=True)
+ self.assertRaises(TypeError, self.dumps, data, indent=True)
+
+
+class TestPyFail(TestFail, PyTest): pass
+class TestCFail(TestFail, CTest): pass