Skip to content

Commit

Permalink
Add test for issue #325.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmtroffaes committed Aug 24, 2023
1 parent 2c04e69 commit 8d50c48
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/sphinxcontrib/bibtex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def setup(app: Sphinx) -> Dict[str, Any]:
app.add_role("footcite", FootCiteRole())

return {
"version": "2.6.0a3",
"version": "2.6.0a4",
"env_version": 9,
"parallel_read_safe": True,
"parallel_write_safe": True,
Expand Down
3 changes: 3 additions & 0 deletions test/roots/test-bibfiles_crossref/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
extensions = ["sphinxcontrib.bibtex"]
exclude_patterns = ["_build"]
bibtex_bibfiles = ["test.bib"]
2 changes: 2 additions & 0 deletions test/roots/test-bibfiles_crossref/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. bibliography::
:all:
27 changes: 27 additions & 0 deletions test/roots/test-bibfiles_crossref/test.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@inbook{srivastava+klassen_2016_functionala,
crossref = {srivastava+klassen_2016_functional},
title = {Functional Data and Elastic Registration},
pages = {73--123},
}

@inbook{srivastava+klassen_2016_statistical,
crossref = {srivastava+klassen_2016_functional},
title = {Statistical Modeling of Functional Data},
pages = {269--303},
}

@book{srivastava+klassen_2016_functional,
title = {Functional and Shape Data Analysis},
booktitle = {Functional and Shape Data Analysis},
author = {Srivastava, Anuj and Klassen, Eric P.},
editor = {Bicke, Peter and Diggle, Peter and Fienberg, Stephen E. and Gather, Ursula and Olkin, Ingram and Zeger, Scott},
year = {2016},
series = {Springer {{Series}} in {{Statistics}}},
publisher = {{Springer-Verlag}},
address = {{New York}},
doi = {10.1007/978-1-4939-4020-2},
url = {https://www.springer.com/gp/book/9781493940189},
urldate = {2020-01-12},
isbn = {978-1-4939-4018-9},
langid = {english}
}
8 changes: 8 additions & 0 deletions test/test_bibfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,11 @@ def test_bibfiles_multiple_keys(app, warning) -> None:
)
output = (app.outdir / "index.html").read_text()
assert html_citations(label="1", text=".*Test one.*").search(output)


# https://bitbucket.org/pybtex-devs/pybtex/issues/441/author-editor-fields-not-resolved-via
@pytest.mark.xfail(reason="pybtex bug")
@pytest.mark.sphinx("html", testroot="bibfiles_crossref")
def test_bibfiles_crossref(app, warning) -> None:
app.build()
assert not warning.getvalue()

0 comments on commit 8d50c48

Please sign in to comment.