Skip to content

Commit

Permalink
Test numpydoc backrefs (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmtroffaes authored Aug 27, 2023
1 parent eab9ba8 commit d1b05af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
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

0 comments on commit d1b05af

Please sign in to comment.