diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-03-20 23:35:32 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-03-20 23:35:42 +0900 |
commit | cd08872cc0d3453c01290d75e6b32ef54c872a59 (patch) | |
tree | f543f0fcbe4b7568d24db8a3a704a9fab69941ad | |
parent | cf3de7d62b52aa6a35d61b1e5696be0c0e375f34 (diff) | |
download | sphinx-git-cd08872cc0d3453c01290d75e6b32ef54c872a59.tar.gz |
Fix existence check for JRE was broken
-rw-r--r-- | tests/test_build_epub.py | 6 | ||||
-rw-r--r-- | tox.ini | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_build_epub.py b/tests/test_build_epub.py index 52a6e3dfe..2f09f6d5a 100644 --- a/tests/test_build_epub.py +++ b/tests/test_build_epub.py @@ -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() @@ -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. |