Skip to content

Commit 95d12d0

Browse files
committed
Mark failing tests for test_json
1 parent 5e58b05 commit 95d12d0

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

Lib/test/test_json/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
22
import json
3-
import doctest
3+
# import doctest
44
import unittest
55

66
from test import support
@@ -9,7 +9,8 @@
99
cjson = support.import_fresh_module('json', fresh=['_json'])
1010
pyjson = support.import_fresh_module('json', blocked=['_json'])
1111
# JSONDecodeError is cached inside the _json module
12-
cjson.JSONDecodeError = cjson.decoder.JSONDecodeError = json.JSONDecodeError
12+
# XXX RustPython TODO: _json module
13+
# cjson.JSONDecodeError = cjson.decoder.JSONDecodeError = json.JSONDecodeError
1314

1415
# create two base classes that will be used by the other tests
1516
class PyTest(unittest.TestCase):
@@ -47,8 +48,8 @@ def test_cjson(self):
4748

4849
def load_tests(loader, _, pattern):
4950
suite = unittest.TestSuite()
50-
for mod in (json, json.encoder, json.decoder):
51-
suite.addTest(doctest.DocTestSuite(mod))
51+
# for mod in (json, json.encoder, json.decoder):
52+
# suite.addTest(doctest.DocTestSuite(mod))
5253
suite.addTest(TestPyTest('test_pyjson'))
5354
suite.addTest(TestCTest('test_cjson'))
5455

Lib/test/test_json/test_fail.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import unittest
12
from test.test_json import PyTest, CTest
23

34
# 2007-10-05
@@ -78,6 +79,7 @@
7879
}
7980

8081
class TestFail:
82+
@unittest.skip("TODO: RUSTPYTHON")
8183
def test_failures(self):
8284
for idx, doc in enumerate(JSONDOCS):
8385
idx = idx + 1
@@ -103,6 +105,7 @@ def test_not_serializable(self):
103105
'Object of type module is not JSON serializable'):
104106
self.dumps(sys)
105107

108+
@unittest.skip("TODO: RUSTPYTHON")
106109
def test_truncated_input(self):
107110
test_cases = [
108111
('', 'Expecting value', 0),

Lib/test/test_json/test_scanstring.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import unittest
12
import sys
23
from test.test_json import PyTest, CTest
34

@@ -85,6 +86,7 @@ def test_scanstring(self):
8586
scanstring('["Bad value", truth]', 2, True),
8687
('Bad value', 12))
8788

89+
@unittest.skip("TODO: RUSTPYTHON")
8890
def test_surrogates(self):
8991
scanstring = self.json.decoder.scanstring
9092
def assertScan(given, expect):
@@ -101,6 +103,7 @@ def assertScan(given, expect):
101103
assertScan('"z\ud834\\udd20x"', 'z\ud834\udd20x')
102104
assertScan('"z\ud834x"', 'z\ud834x')
103105

106+
@unittest.skip("TODO: RUSTPYTHON")
104107
def test_bad_escapes(self):
105108
scanstring = self.json.decoder.scanstring
106109
bad_escapes = [
@@ -132,6 +135,7 @@ def test_bad_escapes(self):
132135
with self.assertRaises(self.JSONDecodeError, msg=s):
133136
scanstring(s, 1, True)
134137

138+
@unittest.skip("TODO: RUSTPYTHON")
135139
def test_overflow(self):
136140
with self.assertRaises(OverflowError):
137141
self.json.decoder.scanstring(b"xxx", sys.maxsize+1)

Lib/test/test_json/test_tool.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from test.support.script_helper import assert_python_ok
88

99

10+
@unittest.skip("TODO: RUSTPYTHON") # Need to fix subprocess to take env
1011
class TestTool(unittest.TestCase):
1112
data = """
1213

Lib/test/test_json/test_unicode.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import unittest
12
import codecs
23
from collections import OrderedDict
34
from test.test_json import PyTest, CTest
@@ -7,21 +8,25 @@ class TestUnicode:
78
# test_encoding1 and test_encoding2 from 2.x are irrelevant (only str
89
# is supported as input, not bytes).
910

11+
@unittest.skip("TODO: RUSTPYTHON")
1012
def test_encoding3(self):
1113
u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
1214
j = self.dumps(u)
1315
self.assertEqual(j, '"\\u03b1\\u03a9"')
1416

17+
@unittest.skip("TODO: RUSTPYTHON")
1518
def test_encoding4(self):
1619
u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
1720
j = self.dumps([u])
1821
self.assertEqual(j, '["\\u03b1\\u03a9"]')
1922

23+
@unittest.skip("TODO: RUSTPYTHON")
2024
def test_encoding5(self):
2125
u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
2226
j = self.dumps(u, ensure_ascii=False)
2327
self.assertEqual(j, '"{0}"'.format(u))
2428

29+
@unittest.skip("TODO: RUSTPYTHON")
2530
def test_encoding6(self):
2631
u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
2732
j = self.dumps([u], ensure_ascii=False)
@@ -37,6 +42,8 @@ def test_big_unicode_decode(self):
3742
self.assertEqual(self.loads('"' + u + '"'), u)
3843
self.assertEqual(self.loads('"z\\ud834\\udd20x"'), u)
3944

45+
# just takes FOREVER (3min+), unskip when it doesn't
46+
@unittest.skip("TODO: RUSTPYTHON time")
4047
def test_unicode_decode(self):
4148
for i in range(0, 0xd7ff):
4249
u = chr(i)
@@ -52,6 +59,7 @@ def test_bytes_encode(self):
5259
self.assertRaises(TypeError, self.dumps, b"hi")
5360
self.assertRaises(TypeError, self.dumps, [b"hi"])
5461

62+
@unittest.skip("TODO: RUSTPYTHON")
5563
def test_bytes_decode(self):
5664
for encoding, bom in [
5765
('utf-8', codecs.BOM_UTF8),

0 commit comments

Comments
 (0)