# HG changeset patch # User Yuya Nishihara # Date 1471434770 -32400 # Node ID 7025693433b2ba12cbe72587364e62d3d14d0cdf # Parent 8d226db31f20b8c4a2c119e10be7533948f0bad6 py3: have check-py3-compat require pygments to get stable result diff -r 8d226db31f20 -r 7025693433b2 tests/hghave.py --- a/tests/hghave.py Tue Aug 09 17:06:35 2016 +0200 +++ b/tests/hghave.py Wed Aug 17 20:52:50 2016 +0900 @@ -544,6 +544,16 @@ def has_python3exe(): return 'PYTHON3' in os.environ +@check("py3pygments", "Pygments available on Python 3.x") +def has_py3pygments(): + if has_py3k(): + return has_pygments() + elif has_python3exe(): + # just check exit status (ignoring output) + py3 = os.environ['PYTHON3'] + return matchoutput('%s -c "import pygments"' % py3, br'') + return False + @check("pure", "running with pure Python code") def has_pure(): return any([ diff -r 8d226db31f20 -r 7025693433b2 tests/test-check-py3-compat.t --- a/tests/test-check-py3-compat.t Tue Aug 09 17:06:35 2016 +0200 +++ b/tests/test-check-py3-compat.t Wed Aug 17 20:52:50 2016 +0900 @@ -12,7 +12,7 @@ setup.py not using absolute_import tests/test-demandimport.py not using absolute_import -#if py3exe +#if py3exe py3pygments $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py doc/hgmanpage.py: invalid syntax: invalid syntax (, line *) (glob) hgext/acl.py: error importing: str expected, not bytes (error at encoding.py:*) (glob) @@ -48,7 +48,7 @@ hgext/gpg.py: error importing: str expected, not bytes (error at encoding.py:*) (glob) hgext/graphlog.py: error importing: str expected, not bytes (error at encoding.py:*) (glob) hgext/hgk.py: error importing: str expected, not bytes (error at encoding.py:*) (glob) - hgext/highlight/highlight.py: error importing module: No module named 'pygments' (line 13) + hgext/highlight/highlight.py: error importing: str expected, not bytes (error at encoding.py:*) (glob) hgext/histedit.py: error importing: str expected, not bytes (error at encoding.py:*) (glob) hgext/journal.py: error importing: str expected, not bytes (error at encoding.py:*) (glob) hgext/keyword.py: error importing: str expected, not bytes (error at encoding.py:*) (glob)