+++ /dev/null
-"""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()
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))
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()
--- /dev/null
+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
# 2007-10-05
JSONDOCS = [
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:
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 \
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