mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #4763 from tk0miya/4611_epubcheck
Fix existence check for JRE was broken
This commit is contained in:
commit
948f8c94d9
@ -19,13 +19,13 @@ import pytest
|
||||
# check given command is runnable
|
||||
def runnable(command):
|
||||
try:
|
||||
p = Popen(command, stdout=PIPE)
|
||||
p = Popen(command, stdout=PIPE, stderr=PIPE)
|
||||
except OSError:
|
||||
# command not found
|
||||
return False
|
||||
else:
|
||||
p.communicate()
|
||||
return p.returncode
|
||||
return p.returncode == 0
|
||||
|
||||
|
||||
class EPUBElementTree(object):
|
||||
@ -322,7 +322,7 @@ def test_run_epubcheck(app):
|
||||
app.build()
|
||||
|
||||
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'],
|
||||
stdout=PIPE, stderr=PIPE)
|
||||
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]
|
||||
usedevelop = True
|
||||
passenv =
|
||||
https_proxy http_proxy no_proxy PERL PERL5LIB PYTEST_ADDOPTS
|
||||
https_proxy http_proxy no_proxy PERL PERL5LIB PYTEST_ADDOPTS EPUBCHECK_PATH
|
||||
description =
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user