#18273: merge with 3.3.

This commit is contained in:
Ezio Melotti 2013-08-08 15:18:26 +03:00
commit 5cc06fde43
21 changed files with 25 additions and 44 deletions

View File

@ -1,17 +0,0 @@
"""Tests for json.
The tests for json are defined in the json.tests package;
the test_suite() function there returns a test suite that's ready to
be run.
"""
from test import json_tests
import test.support
def test_main():
test.support.run_unittest(json_tests.test_suite())
if __name__ == "__main__":
test_main()

View File

@ -44,12 +44,12 @@ class TestCTest(CTest):
here = os.path.dirname(__file__)
def test_suite():
def load_tests(*args):
suite = additional_tests()
loader = unittest.TestLoader()
for fn in os.listdir(here):
if fn.startswith("test") and fn.endswith(".py"):
modname = "test.json_tests." + fn[:-3]
modname = "test.test_json." + fn[:-3]
__import__(modname)
module = sys.modules[modname]
suite.addTests(loader.loadTestsFromModule(module))
@ -62,12 +62,3 @@ def additional_tests():
suite.addTest(TestPyTest('test_pyjson'))
suite.addTest(TestCTest('test_cjson'))
return suite
def main():
suite = test_suite()
runner = unittest.TextTestRunner()
runner.run(suite)
if __name__ == '__main__':
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
main()

View File

@ -0,0 +1,4 @@
import unittest
from test.test_json import load_tests
unittest.main()

View File

@ -1,7 +1,7 @@
import decimal
from io import StringIO
from collections import OrderedDict
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
class TestDecode:

View File

@ -1,4 +1,4 @@
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
class TestDefault:

View File

@ -1,5 +1,5 @@
from io import StringIO
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
from test.support import bigmemtest, _1G

View File

@ -1,5 +1,5 @@
from collections import OrderedDict
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
CASES = [

View File

@ -1,4 +1,4 @@
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
import re
# 2007-10-05

View File

@ -1,5 +1,5 @@
import math
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
class TestFloat:

View File

@ -1,6 +1,6 @@
import textwrap
from io import StringIO
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
class TestIndent:

View File

@ -1,4 +1,4 @@
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
# from http://json.org/JSON_checker/test/pass1.json

View File

@ -1,4 +1,4 @@
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
# from http://json.org/JSON_checker/test/pass2.json

View File

@ -1,4 +1,4 @@
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
# from http://json.org/JSON_checker/test/pass3.json

View File

@ -1,4 +1,4 @@
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
class JSONTestObject:

View File

@ -1,5 +1,5 @@
import sys
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
class TestScanstring:

View File

@ -1,5 +1,5 @@
import textwrap
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
class TestSeparators:

View File

@ -1,4 +1,4 @@
from test.json_tests import CTest
from test.test_json import CTest
class TestSpeedups(CTest):

View File

@ -1,5 +1,5 @@
from collections import OrderedDict
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
class TestUnicode:

View File

@ -1079,7 +1079,7 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
test/namespace_pkgs/module_and_namespace_package/a_test \
collections concurrent concurrent/futures encodings \
email email/mime test/test_email test/test_email/data \
html json test/json_tests http dbm xmlrpc \
html json test/test_json http dbm xmlrpc \
sqlite3 sqlite3/test \
logging csv wsgiref urllib \
lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \

View File

@ -634,6 +634,9 @@ Library
Tests
-----
- Issue #18273: move the tests in Lib/test/json_tests to Lib/test/test_json
and make them discoverable by unittest. Patch by Zachary Ware.
- Fix a fcntl test case on KFreeBSD, Debian #708653 (Petr Salinger).
- Issue #18396: Fix spurious test failure in test_signal on Windows when