# HG changeset patch # User Yuya Nishihara # Date 2018-09-02 07:26:33 # Node ID ecbab8be74705dc32fbbd1adf243e7e011220a81 # Parent 0cbcf962847e50326e47a3e60b277f710dc01c73 test-check-py3-compat: don't run py3 part if not build against python3 This test depends on C extensions built for python3, which aren't available if run-tests.py runs on python2 and no -l/--local is specified. diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -633,16 +633,6 @@ def has_py3k(): def has_python3exe(): return matchoutput('python3 -V', br'^Python 3.(5|6|7|8|9)') -@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 --git a/tests/test-check-py3-compat.t b/tests/test-check-py3-compat.t --- a/tests/test-check-py3-compat.t +++ b/tests/test-check-py3-compat.t @@ -24,13 +24,13 @@ setup.py not using absolute_import #endif -#if py3exe +#if py3k $ testrepohg files 'set:(**.py) - grep(pygments)' \ > -X hgdemandimport/demandimportpy2.py \ > -X hgext/fsmonitor/pywatchman \ > -X mercurial/cffi \ > -X mercurial/thirdparty \ - > | sed 's|\\|/|g' | xargs python3 contrib/check-py3-compat.py \ + > | sed 's|\\|/|g' | xargs $PYTHON contrib/check-py3-compat.py \ > | sed 's/[0-9][0-9]*)$/*)/' hgext/convert/transport.py: error importing: <*Error> No module named 'svn.client' (error at transport.py:*) (glob) (?) hgext/infinitepush/sqlindexapi.py: error importing: <*Error> No module named 'mysql' (error at sqlindexapi.py:*) (glob) (?) @@ -40,8 +40,8 @@ #endif -#if py3exe py3pygments +#if py3k pygments $ testrepohg files 'set:(**.py) and grep(pygments)' | sed 's|\\|/|g' \ - > | xargs python3 contrib/check-py3-compat.py \ + > | xargs $PYTHON contrib/check-py3-compat.py \ > | sed 's/[0-9][0-9]*)$/*)/' #endif