Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arrow/arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,7 @@ def is_between(
)

if not isinstance(end, Arrow):
raise TypeError(f"Cannot parse end date argument type of {type(start)!r}.")
raise TypeError(f"Cannot parse end date argument type of {type(end)!r}.")

include_start = bounds[0] == "["
include_end = bounds[1] == "]"
Expand Down
10 changes: 10 additions & 0 deletions tests/test_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3047,6 +3047,16 @@ def test_type_error_exception(self):
with pytest.raises(TypeError):
target.is_between(None, None)

def test_is_between_error_message_mentions_end_type(self):
target = arrow.Arrow.fromdatetime(datetime(2013, 5, 7))
start = arrow.Arrow.fromdatetime(datetime(2013, 5, 5))
end = datetime(2013, 5, 8)
with pytest.raises(TypeError) as excinfo:
target.is_between(start, end)
assert "end" in str(excinfo.value)
assert "datetime" in str(excinfo.value)
assert "Arrow" not in str(excinfo.value)

def test_value_error_exception(self):
target = arrow.Arrow.fromdatetime(datetime(2013, 5, 7))
start = arrow.Arrow.fromdatetime(datetime(2013, 5, 5))
Expand Down
Loading