XFAIL some tests, 2.7 and Win32 can't use unicode path

This commit is contained in:
Andy Neebel 2017-06-14 13:00:46 -05:00
parent 062c36aaf1
commit c1a6579eb6

View File

@ -15,6 +15,7 @@ import mock
import pytest
from textwrap import dedent
from sphinx.errors import SphinxError
import os
from sphinx.testing.path import path
@ -31,8 +32,13 @@ def nonascii_srcdir(request, rootdir, sphinx_test_tempdir):
# If supported, build in a non-ASCII source dir
test_name = u'\u65e5\u672c\u8a9e'
basedir = sphinx_test_tempdir / request.node.originalname
try:
# Windows with versions prior to 3.2 (I think) doesn't support unicode on system path
# so we force a non-unicode path in that case
if sys.platform == "win32":
if not (sys.version_info.major >= 3 and sys.version_info.minor >= 2):
return basedir / 'all'
srcdir = basedir / test_name
try:
if not srcdir.exists():
(rootdir / 'test-root').copytree(srcdir)
except UnicodeEncodeError:
@ -64,6 +70,7 @@ def nonascii_srcdir(request, rootdir, sphinx_test_tempdir):
)
@mock.patch('sphinx.builders.linkcheck.requests.head',
side_effect=request_session_head)
@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows")
def test_build_all(requests_head, make_app, nonascii_srcdir, buildername):
app = make_app(buildername, srcdir=nonascii_srcdir)
app.build()