Skip to content

Commit

Permalink
fix: more test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Jan 25, 2024
1 parent 848c7bd commit a1a0a16
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
12 changes: 4 additions & 8 deletions jupyter_book/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,6 @@ def builder_specific_actions(
:param result: the result of the build execution; a status code or and exception
"""

from sphinx.util.osutil import cd

from jupyter_book.pdf import html_to_pdf
from jupyter_book.sphinx import REDIRECT_TEXT

Expand Down Expand Up @@ -598,11 +595,10 @@ def builder_specific_actions(
else:
makecmd = os.environ.get("MAKE", "make")
try:
with cd(output_path):
output = subprocess.run([makecmd, "all-pdf"])
if output.returncode != 0:
_error("Error: Failed to build pdf")
return output.returncode
output = subprocess.run([makecmd, "all-pdf"], cwd=output_path)
if output.returncode != 0:
_error("Error: Failed to build pdf")
return output.returncode

Check warning on line 601 in jupyter_book/cli/main.py

View check run for this annotation

Codecov / codecov/patch

jupyter_book/cli/main.py#L600-L601

Added lines #L600 - L601 were not covered by tests
_message_box(
f"""\
A PDF of your {cmd_type} can be found at:
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ filterwarnings = [
'''ignore:'imghdr' is deprecated and slated for removal in Python 3\.13:DeprecationWarning''',
# jupyter-client throws this
'ignore:datetime\.datetime\.utcfromtimestamp\(\) is deprecated:DeprecationWarning',
'ignore:datetime\.datetime\.utcnow\(\) is deprecated:DeprecationWarning',
# pybtex
'ignore:pkg_resources is deprecated as an API:DeprecationWarning',
'ignore:Deprecated call to `pkg_resources:DeprecationWarning'
'ignore:Deprecated call to `pkg_resources:DeprecationWarning',
]
1 change: 1 addition & 0 deletions tests/test_clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def test_clean_html(cli, build_resources):
books, tocs = build_resources
path = books.joinpath("clean_cache")
build_path = path.joinpath("_build")
print(path.as_posix())
result = cli.invoke(build, path.as_posix())
assert result.exit_code == 0

Expand Down

0 comments on commit a1a0a16

Please sign in to comment.