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 numpydoc backrefs #296

Merged
merged 2 commits into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
pytest-options: ''
# numpydoc tests
- python-version: '3.11'
pip-sphinx: 'sphinx numpydoc'
pip-sphinx: 'sphinx https://github.com/numpy/numpydoc/archive/refs/heads/master.zip'
pytest-options: '-m "numpydoc"'
# rinohtype tests
- python-version: '3.11'
Expand Down
7 changes: 4 additions & 3 deletions test/test_numpydoc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from test.common import (
html_citation_refs,
html_citation_refs_single,
html_citations,
html_footnote_refs,
html_footnotes,
Expand Down Expand Up @@ -48,14 +48,15 @@ def test_numpydoc(app, warning) -> None:
"Elf",
]
for label, title in zip(labels, titles):
assert len(html_citation_refs(label=label).findall(output)) == 1
assert len(html_citation_refs_single(label=label).findall(output)) == 1
assert len(html_citations(label=label).findall(output)) == 1
match_ref = html_citation_refs(label=label).search(output)
match_ref = html_citation_refs_single(label=label).search(output)
match = html_citations(label=label).search(output)
assert match_ref
assert match
assert match_ref.group("refid") == match.group("id_")
assert title in match.group("text")
assert match_ref.group("id_") == match.group("backref")
output2 = (app.outdir / "doc_footcite.html").read_text()
assert len(html_footnote_refs().findall(output2)) == 11
for title in titles:
Expand Down