# HG changeset patch # User Yuya Nishihara # Date 1452313215 -32400 # Node ID 562a073a2a1b468efa17b46ca49b158664f8957b # Parent 3b4537ba80e9471b9a8021fb0c5f24c74a7fc302 tests: load json with no fallback The json module should be available in Python 2.6 or newer. diff -r 3b4537ba80e9 -r 562a073a2a1b tests/hghave.py --- a/tests/hghave.py Tue Dec 15 23:50:48 2015 +0900 +++ b/tests/hghave.py Sat Jan 09 13:20:15 2016 +0900 @@ -335,21 +335,6 @@ except ImportError: return False -@check("json", "some json module available") -def has_json(): - try: - import json - json.dumps - return True - except ImportError: - try: - import simplejson as json - json.dumps - return True - except ImportError: - pass - return False - @check("outer-repo", "outer repo") def has_outer_repo(): # failing for other reasons than 'no repo' imply that there is a repo diff -r 3b4537ba80e9 -r 562a073a2a1b tests/run-tests.py --- a/tests/run-tests.py Tue Dec 15 23:50:48 2015 +0900 +++ b/tests/run-tests.py Sat Jan 09 13:20:15 2016 +0900 @@ -48,6 +48,7 @@ from distutils import version import difflib import errno +import json import optparse import os import shutil @@ -69,15 +70,6 @@ import unittest osenvironb = getattr(os, 'environb', os.environ) - -try: - import json -except ImportError: - try: - import simplejson as json - except ImportError: - json = None - processlock = threading.Lock() if sys.version_info > (3, 5, 0): @@ -1725,8 +1717,6 @@ xuf.write(doc.toprettyxml(indent=' ', encoding='utf-8')) if self._runner.options.json: - if json is None: - raise ImportError("json module not installed") jsonpath = os.path.join(self._runner._testdir, 'report.json') with open(jsonpath, 'w') as fp: timesd = {} diff -r 3b4537ba80e9 -r 562a073a2a1b tests/test-hgweb-json.t --- a/tests/test-hgweb-json.t Tue Dec 15 23:50:48 2015 +0900 +++ b/tests/test-hgweb-json.t Sat Jan 09 13:20:15 2016 +0900 @@ -1,4 +1,3 @@ -#require json #require serve $ request() { diff -r 3b4537ba80e9 -r 562a073a2a1b tests/test-run-tests.t --- a/tests/test-run-tests.t Tue Dec 15 23:50:48 2015 +0900 +++ b/tests/test-run-tests.t Sat Jan 09 13:20:15 2016 +0900 @@ -530,8 +530,6 @@ "result": "skip" } } (no-eol) -#if json - test for --json ================== @@ -634,8 +632,6 @@ } (no-eol) $ mv backup test-failure.t -#endif - backslash on end of line with glob matching is handled properly $ cat > test-glob-backslash.t << EOF