Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Do test with docutils-0.17b1 #8870

Merged
merged 6 commits into from Apr 3, 2021

Conversation

tk0miya
Copy link
Member

@tk0miya tk0miya commented Feb 11, 2021

Feature or Bugfix

  • Testing

@tk0miya tk0miya added this to the 3.5.0 milestone Feb 11, 2021
@tk0miya tk0miya force-pushed the test_with_docutils0.17b1 branch 2 times, most recently from e6e8908 to 5012b12 Compare February 12, 2021 00:34
if docutils.__version_info__ < (0, 17):
FIGURE_CAPTION = ".//div[@class='figure align-default']/p[@class='caption']"
else:
FIGURE_CAPTION = ".//figure/figcaption/p"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since v0.17, docutils starts to use <figure> and <figcaption> for figure and its caption on HTML output.

@@ -74,7 +74,7 @@ def test_mangle_signature():


def test_extract_summary(capsys):
settings = Mock(language_code='',
settings = Mock(language_code='en',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since v0.17, docutils starts to load language module on parsing reST document using StateMachine directly. So far, our testcase uses invalid language code for testing autosummary.

assert_count(expected_expr, result, 1)
else:
expected_expr = """<iframe src="http://sphinx-doc.org"></iframe></section>"""
assert_count(expected_expr, result, 1)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since v0.17, docutils starts to use

for section on HTML output.

expected_expr = '<p class="caption"><span class="caption-text">HIDDEN TOC</span></p>'
assert expected_expr in result
else:
expected_expr = '<p><span class="caption-text">HIDDEN TOC</span></p>'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a side-effect of migration to <figcaption>, the caption of toctree is also rendered using <figcaption>, and it's broken (closing tag is missing). It would be better to use another node for toctree caption.

nschloe pushed a commit to live-clones/docutils that referenced this pull request Feb 13, 2021
Third-party applications may (ab)use the "caption" element
for other purposes as a figure caption.

See sphinx-doc/sphinx#8870

git-svn-id: svn://svn.code.sf.net/p/docutils/code/trunk@8624 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
jwilk pushed a commit to jwilk-mirrors/docutils that referenced this pull request Feb 13, 2021
Third-party applications may (ab)use the "caption" element
for other purposes as a figure caption.

See sphinx-doc/sphinx#8870

git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8624 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
@tk0miya tk0miya modified the milestones: 3.5.0, 4.0.0 Feb 14, 2021
Since v0.17, docutils starts to use <figure> and <figcaption> for figure
and its caption on HTML output.  This modifies the expected value of our
testcases to support it.
Since v0.17, docutils starts to load language module on parsing reST
document using StateMachine directly.  So far, our testcase uses invalid
language code for testing autosummary.  This fixes it to work with new
docutils.
Since v0.17, docutils starts to use <section> for section on HTML
output.  This modifies the expected value of our testcases to support
it.
Since v0.17, docutils starts to use <figcaption> for caption on HTML
output.  This modifies the expected value of our testcases to support
it.
@tk0miya tk0miya changed the base branch from 3.x to 3.5.x April 3, 2021 14:55
@tk0miya tk0miya merged commit 64b69ad into sphinx-doc:3.5.x Apr 3, 2021
@tk0miya tk0miya deleted the test_with_docutils0.17b1 branch April 3, 2021 15:05
tk0miya added a commit to tk0miya/sphinx that referenced this pull request Apr 4, 2021
Since docutils-0.17, the caption node should not use for the non-figure
nodes.  Therefore, this replaces it by the title node.
tk0miya added a commit to tk0miya/sphinx that referenced this pull request Apr 4, 2021
Since docutils-0.17, the caption node should not use for the non-figure
nodes.  Therefore, this replaces it by the title node.
tk0miya added a commit to tk0miya/sphinx that referenced this pull request Apr 4, 2021
Since docutils-0.17, the caption node should not use for the non-figure
nodes.  Therefore, this replaces it by the title node.
tk0miya added a commit to tk0miya/sphinx that referenced this pull request Apr 4, 2021
Since docutils-0.17, the caption node should not use for the non-figure
nodes.  Therefore, this replaces it by the title node.
tk0miya added a commit to tk0miya/sphinx that referenced this pull request Apr 8, 2021
Since docutils-0.17, the caption node should not use for the non-figure
nodes.  Therefore, this replaces it by the title node.
tk0miya added a commit that referenced this pull request Apr 8, 2021
Fix #8870: Use title node for the caption of toctree
tk0miya added a commit that referenced this pull request Apr 8, 2021
Since docutils-0.17, the caption node should not use for the non-figure
nodes.  Therefore, this replaces it by the title node.
@tk0miya tk0miya mentioned this pull request Apr 9, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant