Commit 09b724f6 authored by Ezio Melotti's avatar Ezio Melotti

#18273: merge with 3.3.

parents d11133c5 68d7c26a
"""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()
......@@ -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()
import unittest
from test.test_json import load_tests
unittest.main()
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:
......
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
class TestDefault:
......
from io import StringIO
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
from test.support import bigmemtest, _1G
......
from collections import OrderedDict
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
CASES = [
......
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
import re
# 2007-10-05
......
import math
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
class TestFloat:
......
import textwrap
from io import StringIO
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
class TestIndent:
......
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
# from http://json.org/JSON_checker/test/pass1.json
......
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
# from http://json.org/JSON_checker/test/pass2.json
......
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
# from http://json.org/JSON_checker/test/pass3.json
......
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
class JSONTestObject:
......
import sys
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
class TestScanstring:
......
import textwrap
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
class TestSeparators:
......
from test.json_tests import CTest
from test.test_json import CTest
class TestSpeedups(CTest):
......
from collections import OrderedDict
from test.json_tests import PyTest, CTest
from test.test_json import PyTest, CTest
class TestUnicode:
......
......@@ -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 \
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment