summaryrefslogtreecommitdiffstats
path: root/Lib/test/json_tests/test_fail.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2011-05-14 22:26:35 (GMT)
committerGregory P. Smith <greg@krypto.org>2011-05-14 22:26:35 (GMT)
commit873cab28903eb6a9063b502d7e9fe9555fc0cfd7 (patch)
treeec7079b6ae9ce221158c134d18b64a336284d115 /Lib/test/json_tests/test_fail.py
parent12c9d028ed0a1803019f3796014e75c74d9de2f6 (diff)
parent95e686686f600e6df18c32a5e808949517655868 (diff)
downloadcpython-873cab28903eb6a9063b502d7e9fe9555fc0cfd7.zip
cpython-873cab28903eb6a9063b502d7e9fe9555fc0cfd7.tar.gz
cpython-873cab28903eb6a9063b502d7e9fe9555fc0cfd7.tar.bz2
merge heads.
Diffstat (limited to 'Lib/test/json_tests/test_fail.py')
-rw-r--r--Lib/test/json_tests/test_fail.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/Lib/test/json_tests/test_fail.py b/Lib/test/json_tests/test_fail.py
index 9768edf..fcff1d4 100644
--- a/Lib/test/json_tests/test_fail.py
+++ b/Lib/test/json_tests/test_fail.py
@@ -1,6 +1,4 @@
-from unittest import TestCase
-
-import json
+from test.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:
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