diff options
author | Zachary Ware <zachary.ware@gmail.com> | 2014-07-23 17:06:47 (GMT) |
---|---|---|
committer | Zachary Ware <zachary.ware@gmail.com> | 2014-07-23 17:06:47 (GMT) |
commit | f886697659a6ce9541bfc271d34929f3b225243e (patch) | |
tree | db3f5ecab45ee4ab5c81eeda74d8bb82d33fd6d3 /Lib/test/test_json | |
parent | b848944d728faf9a5e6f4424a5c270734cbe4ce8 (diff) | |
parent | f012ba42fe54253378a2784aaf7177aa36be579a (diff) | |
download | cpython-f886697659a6ce9541bfc271d34929f3b225243e.zip cpython-f886697659a6ce9541bfc271d34929f3b225243e.tar.gz cpython-f886697659a6ce9541bfc271d34929f3b225243e.tar.bz2 |
Closes #22002: Merge with 3.4
Diffstat (limited to 'Lib/test/test_json')
-rw-r--r-- | Lib/test/test_json/__init__.py | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/Lib/test/test_json/__init__.py b/Lib/test/test_json/__init__.py index f994f9b..2cf1032 100644 --- a/Lib/test/test_json/__init__.py +++ b/Lib/test/test_json/__init__.py @@ -42,23 +42,12 @@ class TestCTest(CTest): '_json') -here = os.path.dirname(__file__) - -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.test_json." + fn[:-3] - __import__(modname) - module = sys.modules[modname] - suite.addTests(loader.loadTestsFromModule(module)) - return suite - -def additional_tests(): +def load_tests(loader, _, pattern): suite = unittest.TestSuite() for mod in (json, json.encoder, json.decoder): suite.addTest(doctest.DocTestSuite(mod)) suite.addTest(TestPyTest('test_pyjson')) suite.addTest(TestCTest('test_cjson')) - return suite + + pkg_dir = os.path.dirname(__file__) + return support.load_package_tests(pkg_dir, loader, suite, pattern) |