summaryrefslogtreecommitdiff
path: root/tests/test_build.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_build.py')
-rw-r--r--tests/test_build.py26
1 files changed, 10 insertions, 16 deletions
diff --git a/tests/test_build.py b/tests/test_build.py
index 857e3c8b7..399530ed6 100644
--- a/tests/test_build.py
+++ b/tests/test_build.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""
test_build
~~~~~~~~~~
@@ -31,13 +30,8 @@ def request_session_head(url, **kwargs):
@pytest.fixture
def nonascii_srcdir(request, rootdir, sphinx_test_tempdir):
# If supported, build in a non-ASCII source dir
- test_name = u'\u65e5\u672c\u8a9e'
+ test_name = '\u65e5\u672c\u8a9e'
basedir = sphinx_test_tempdir / request.node.originalname
- # 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" and
- not (sys.version_info.major >= 3 and sys.version_info.minor >= 2)):
- return basedir / 'all'
try:
srcdir = basedir / test_name
if not srcdir.exists():
@@ -51,8 +45,8 @@ def nonascii_srcdir(request, rootdir, sphinx_test_tempdir):
=======================
"""))
- master_doc = srcdir / 'contents.txt'
- master_doc.write_text(master_doc.text() + dedent(u"""
+ master_doc = srcdir / 'index.txt'
+ master_doc.write_text(master_doc.text() + dedent("""
.. toctree::
%(test_name)s/%(test_name)s
@@ -66,7 +60,7 @@ def nonascii_srcdir(request, rootdir, sphinx_test_tempdir):
"buildername",
[
# note: no 'html' - if it's ok with dirhtml it's ok with html
- 'dirhtml', 'singlehtml', 'pickle', 'json', 'text', 'htmlhelp', 'qthelp',
+ 'dirhtml', 'singlehtml', 'pickle', 'json', 'text', 'htmlhelp',
'applehelp', 'changes', 'xml', 'pseudoxml', 'linkcheck',
],
)
@@ -79,12 +73,12 @@ def test_build_all(requests_head, make_app, nonascii_srcdir, buildername):
def test_master_doc_not_found(tempdir, make_app):
- (tempdir / 'conf.py').write_text('master_doc = "index"')
+ (tempdir / 'conf.py').write_text('')
assert tempdir.listdir() == ['conf.py']
app = make_app('dummy', srcdir=tempdir)
with pytest.raises(SphinxError):
- app.builder.build_all()
+ app.builder.build_all() # no index.rst
@pytest.mark.sphinx(buildername='text', testroot='circular')
@@ -93,10 +87,10 @@ def test_circular_toctree(app, status, warning):
warnings = warning.getvalue()
assert (
'circular toctree references detected, ignoring: '
- 'sub <- contents <- sub') in warnings
+ 'sub <- index <- sub') in warnings
assert (
'circular toctree references detected, ignoring: '
- 'contents <- sub <- contents') in warnings
+ 'index <- sub <- index') in warnings
@pytest.mark.sphinx(buildername='text', testroot='numbered-circular')
@@ -105,10 +99,10 @@ def test_numbered_circular_toctree(app, status, warning):
warnings = warning.getvalue()
assert (
'circular toctree references detected, ignoring: '
- 'sub <- contents <- sub') in warnings
+ 'sub <- index <- sub') in warnings
assert (
'circular toctree references detected, ignoring: '
- 'contents <- sub <- contents') in warnings
+ 'index <- sub <- index') in warnings
@pytest.mark.sphinx(buildername='dummy', testroot='images')