mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix existence check for JRE was broken
This commit is contained in:
@@ -19,13 +19,13 @@ import pytest
|
|||||||
# check given command is runnable
|
# check given command is runnable
|
||||||
def runnable(command):
|
def runnable(command):
|
||||||
try:
|
try:
|
||||||
p = Popen(command, stdout=PIPE)
|
p = Popen(command, stdout=PIPE, stderr=PIPE)
|
||||||
except OSError:
|
except OSError:
|
||||||
# command not found
|
# command not found
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
p.communicate()
|
p.communicate()
|
||||||
return p.returncode
|
return p.returncode == 0
|
||||||
|
|
||||||
|
|
||||||
class EPUBElementTree(object):
|
class EPUBElementTree(object):
|
||||||
@@ -322,7 +322,7 @@ def test_run_epubcheck(app):
|
|||||||
app.build()
|
app.build()
|
||||||
|
|
||||||
epubcheck = os.environ.get('EPUBCHECK_PATH', '/usr/share/java/epubcheck.jar')
|
epubcheck = os.environ.get('EPUBCHECK_PATH', '/usr/share/java/epubcheck.jar')
|
||||||
if runnable('java') and os.path.exists(epubcheck):
|
if runnable(['java', '-version']) and os.path.exists(epubcheck):
|
||||||
p = Popen(['java', '-jar', epubcheck, app.outdir / 'SphinxTests.epub'],
|
p = Popen(['java', '-jar', epubcheck, app.outdir / 'SphinxTests.epub'],
|
||||||
stdout=PIPE, stderr=PIPE)
|
stdout=PIPE, stderr=PIPE)
|
||||||
stdout, stderr = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
|
|||||||
2
tox.ini
2
tox.ini
@@ -5,7 +5,7 @@ envlist = docs,flake8,mypy,coverage,py{27,34,35,36,py},du{11,12,13,14}
|
|||||||
[testenv]
|
[testenv]
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
passenv =
|
passenv =
|
||||||
https_proxy http_proxy no_proxy PERL PERL5LIB PYTEST_ADDOPTS
|
https_proxy http_proxy no_proxy PERL PERL5LIB PYTEST_ADDOPTS EPUBCHECK_PATH
|
||||||
description =
|
description =
|
||||||
py{27,34,35,36,py}: Run unit tests against {envname}.
|
py{27,34,35,36,py}: Run unit tests against {envname}.
|
||||||
du{11,12,13,14}: Run unit tests with the given version of docutils.
|
du{11,12,13,14}: Run unit tests with the given version of docutils.
|
||||||
|
|||||||
Reference in New Issue
Block a user