Skip to content

Commit d9d042f

Browse files
author
Mark Matchynski
committed
Address parser review feedback
1 parent aaf45af commit d9d042f

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎pythonbible/pythonbible/parser.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ def _process_sub_references(
161161
normalized_sub_reference = sub_reference.strip().lstrip(" .,:;-")
162162

163163
if (
164-
not normalized_sub_reference or normalized_sub_reference in {DASH, PERIOD}
164+
not normalized_sub_reference
165+
or normalized_sub_reference in {DASH}
165166
) and not references:
166167
references.append(NormalizedReference(book, None, None, None, None, book))
167168
continue

‎pythonbible/tests/parser/parser_test.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ def test_get_references_book_name_followed_by_period(
182182
references: list[bible.NormalizedReference] = bible.get_references(text)
183183

184184
# Then the reference is returned without crashing or discarding the chapter/verse
185-
assert references == expected
185+
if references != expected:
186+
raise AssertionError(f"Expected {expected!r}, got {references!r}")
186187

187188

188189
def test_get_references_roman_numerals(

0 commit comments

Comments
 (0)