# HG changeset patch # User Yuya Nishihara # Date 2016-01-09 04:20:15 # Node ID 562a073a2a1b468efa17b46ca49b158664f8957b # Parent 3b4537ba80e9471b9a8021fb0c5f24c74a7fc302 tests: load json with no fallback The json module should be available in Python 2.6 or newer. diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -335,21 +335,6 @@ def has_pygments(): 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 --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -48,6 +48,7 @@ from __future__ import print_function from distutils import version import difflib import errno +import json import optparse import os import shutil @@ -69,15 +70,6 @@ from xml.dom import minidom 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 @@ class TextTestRunner(unittest.TextTestRu 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 --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t --- a/tests/test-hgweb-json.t +++ b/tests/test-hgweb-json.t @@ -1,4 +1,3 @@ -#require json #require serve $ request() { diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t --- a/tests/test-run-tests.t +++ b/tests/test-run-tests.t @@ -530,8 +530,6 @@ Missing skips or blacklisted skips don't "result": "skip" } } (no-eol) -#if json - test for --json ================== @@ -634,8 +632,6 @@ Test that failed test accepted through i } (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