From 3df69838b5a252e4fce6730c8ad04919124bb60d Mon Sep 17 00:00:00 2001 From: delfanbaum Date: Wed, 14 Feb 2024 12:03:20 -0500 Subject: [PATCH] Remove a troublesome print statement And also clean up the error message so it doesn't do silly things like create
elements inside the atlas log unnecessarily --- jupyter_book_to_htmlbook/file_processing.py | 5 ++--- tests/test_file_processing.py | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/jupyter_book_to_htmlbook/file_processing.py b/jupyter_book_to_htmlbook/file_processing.py index b7b8d99..3249005 100644 --- a/jupyter_book_to_htmlbook/file_processing.py +++ b/jupyter_book_to_htmlbook/file_processing.py @@ -186,13 +186,12 @@ def get_main_section(soup): try: main_title = article.find('h1').get_text() except AttributeError: - main_title = soup.find("h1") + main_title = soup.find("h1").get_text() err_msg = f"The chapter with title '{main_title}' " + \ - "has extra
s " + \ + "has extra sections " + \ "that will not be processed. Please check the " + \ "notebook source files." logging.warning(err_msg) - print(err_msg) bibliography = soup.find('section', id="bibliography") return main, bibliography diff --git a/tests/test_file_processing.py b/tests/test_file_processing.py index 42a90f0..35c52f2 100644 --- a/tests/test_file_processing.py +++ b/tests/test_file_processing.py @@ -81,7 +81,6 @@ def test_process_chapter_single_file_with_multiple_h1s(self, process_chapter((test_env / 'many_a_levels.html'), test_env, test_out) log = caplog.text - assert "will not be processed" in capsys.readouterr().out assert "will not be processed" in log def test_process_chapter_single_file_bibliogrpahy(self,