From 3e7113c4c6b91de842e43cb6e0ba254dfb0fe280 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Thu, 14 Feb 2019 02:04:21 +0900 Subject: [PATCH] Fix test_ext_autosectionlabel conflicts with HTML5 writer --- tests/test_ext_autosectionlabel.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/test_ext_autosectionlabel.py b/tests/test_ext_autosectionlabel.py index 77c7a7e44..440860f7a 100644 --- a/tests/test_ext_autosectionlabel.py +++ b/tests/test_ext_autosectionlabel.py @@ -38,12 +38,12 @@ def test_autosectionlabel_html(app, status, warning, skipped_labels=False): 'For UNIX users

') assert re.search(html, content, re.S) - html = ('
  • ' - 'Linux
  • ') + html = ('
  • ' + 'Linux

  • ') assert re.search(html, content, re.S) - html = ('
  • ' - 'FreeBSD
  • ') + html = ('
  • ' + 'FreeBSD

  • ') assert re.search(html, content, re.S) # for smart_quotes (refs: #4027) @@ -62,6 +62,8 @@ def test_autosectionlabel_prefix_document_html(app, status, warning): test_autosectionlabel_html(app, status, warning) +@pytest.mark.skipif(docutils.__version_info__ < (0, 13), + reason='docutils-0.13 or above is required') @pytest.mark.sphinx('html', testroot='ext-autosectionlabel', confoverrides={'autosectionlabel_maxdepth': 3}) def test_autosectionlabel_maxdepth(app, status, warning): @@ -70,22 +72,22 @@ def test_autosectionlabel_maxdepth(app, status, warning): content = (app.outdir / 'index.html').text() # depth: 1 - html = ('
  • ' - 'test-ext-autosectionlabel
  • ') + html = ('
  • ' + 'test-ext-autosectionlabel

  • ') assert re.search(html, content, re.S) # depth: 2 - html = ('
  • ' - 'Installation
  • ') + html = ('
  • ' + 'Installation

  • ') assert re.search(html, content, re.S) # depth: 3 - html = ('
  • ' - 'For Windows users
  • ') + html = ('
  • ' + 'For Windows users

  • ') assert re.search(html, content, re.S) # depth: 4 - html = '
  • Linux
  • ' + html = '
  • Linux

  • ' assert re.search(html, content, re.S) assert 'WARNING: undefined label: linux' in warning.getvalue()