summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_build_html.py36
-rw-r--r--tests/test_smartquotes.py6
-rw-r--r--tests/test_versioning.py10
3 files changed, 2 insertions, 50 deletions
diff --git a/tests/test_build_html.py b/tests/test_build_html.py
index 10fdbdf79..6b18bac1c 100644
--- a/tests/test_build_html.py
+++ b/tests/test_build_html.py
@@ -5,7 +5,6 @@ import re
from itertools import chain, cycle
from unittest.mock import ANY, call, patch
-import docutils
import pytest
from html5lib import HTMLParser
@@ -407,39 +406,6 @@ def test_html5_output(app, cached_etree_parse, fname, expect):
check_xpath(cached_etree_parse(app.outdir / fname), fname, *expect)
-@pytest.mark.skipif(docutils.__version_info__ >= (0, 18), reason='docutils-0.17 or below is required.')
-@pytest.mark.parametrize("fname,expect", flat_dict({
- 'index.html': [
- (".//dt[@class='label']/span[@class='brackets']", r'Ref1'),
- (".//dt[@class='label']", ''),
- ],
- 'footnote.html': [
- (".//a[@class='footnote-reference brackets'][@href='#id9'][@id='id1']", r"1"),
- (".//a[@class='footnote-reference brackets'][@href='#id10'][@id='id2']", r"2"),
- (".//a[@class='footnote-reference brackets'][@href='#foo'][@id='id3']", r"3"),
- (".//a[@class='reference internal'][@href='#bar'][@id='id4']/span", r"\[bar\]"),
- (".//a[@class='reference internal'][@href='#baz-qux'][@id='id5']/span", r"\[baz_qux\]"),
- (".//a[@class='footnote-reference brackets'][@href='#id11'][@id='id6']", r"4"),
- (".//a[@class='footnote-reference brackets'][@href='#id12'][@id='id7']", r"5"),
- (".//a[@class='fn-backref'][@href='#id1']", r"1"),
- (".//a[@class='fn-backref'][@href='#id2']", r"2"),
- (".//a[@class='fn-backref'][@href='#id3']", r"3"),
- (".//a[@class='fn-backref'][@href='#id4']", r"bar"),
- (".//a[@class='fn-backref'][@href='#id5']", r"baz_qux"),
- (".//a[@class='fn-backref'][@href='#id6']", r"4"),
- (".//a[@class='fn-backref'][@href='#id7']", r"5"),
- (".//a[@class='fn-backref'][@href='#id8']", r"6"),
- ],
-}))
-@pytest.mark.sphinx('html')
-@pytest.mark.test_params(shared_result='test_build_html_output_docutils17')
-def test_docutils17_output(app, cached_etree_parse, fname, expect):
- app.build()
- print(app.outdir / fname)
- check_xpath(cached_etree_parse(app.outdir / fname), fname, *expect)
-
-
-@pytest.mark.skipif(docutils.__version_info__[:2] <= (0, 17), reason='docutils-0.18+ is required.')
@pytest.mark.parametrize("fname,expect", flat_dict({
'index.html': [
(".//div[@class='citation']/span", r'Ref1'),
@@ -465,7 +431,7 @@ def test_docutils17_output(app, cached_etree_parse, fname, expect):
}))
@pytest.mark.sphinx('html')
@pytest.mark.test_params(shared_result='test_build_html_output_docutils18')
-def test_docutils18_output(app, cached_etree_parse, fname, expect):
+def test_docutils_output(app, cached_etree_parse, fname, expect):
app.build()
print(app.outdir / fname)
check_xpath(cached_etree_parse(app.outdir / fname), fname, *expect)
diff --git a/tests/test_smartquotes.py b/tests/test_smartquotes.py
index 7a18817f2..1d4e8e127 100644
--- a/tests/test_smartquotes.py
+++ b/tests/test_smartquotes.py
@@ -1,6 +1,5 @@
"""Test smart quotes."""
-import docutils
import pytest
from html5lib import HTMLParser
@@ -44,10 +43,7 @@ def test_man_builder(app, status, warning):
app.build()
content = (app.outdir / 'python.1').read_text(encoding='utf8')
- if docutils.__version_info__ > (0, 18):
- assert r'\-\- \(dqSphinx\(dq is a tool that makes it easy ...' in content
- else:
- assert r'\-\- "Sphinx" is a tool that makes it easy ...' in content
+ assert r'\-\- \(dqSphinx\(dq is a tool that makes it easy ...' in content
@pytest.mark.sphinx(buildername='latex', testroot='smartquotes', freshenv=True)
diff --git a/tests/test_versioning.py b/tests/test_versioning.py
index 107e21560..3172b31a1 100644
--- a/tests/test_versioning.py
+++ b/tests/test_versioning.py
@@ -4,17 +4,9 @@ import pickle
import pytest
-from sphinx import addnodes
from sphinx.testing.util import SphinxTestApp
from sphinx.versioning import add_uids, get_ratio, merge_doctrees
-try:
- from docutils.nodes import meta
-except ImportError:
- # docutils-0.18.0 or older
- from docutils.parsers.rst.directives.html import MetaBody
- meta = MetaBody.meta
-
app = original = original_uids = None
@@ -62,8 +54,6 @@ def test_picklablility():
copy.settings.warning_stream = None
copy.settings.env = None
copy.settings.record_dependencies = None
- for metanode in copy.findall(meta):
- metanode.__class__ = addnodes.meta
loaded = pickle.loads(pickle.dumps(copy, pickle.HIGHEST_PROTOCOL))
assert all(getattr(n, 'uid', False) for n in loaded.findall(is_paragraph))