From 531131191e54a0cf66f658f33a90e8e1d01e6023 Mon Sep 17 00:00:00 2001 From: Dylan Pulver Date: Mon, 2 Nov 2026 13:46:52 -0500 Subject: [PATCH] Collect the two invalid-unit tests start_of_with_invalid_unit and end_of_with_invalid_unit sit between 48 collected tests in the same file, each with a pytest.raises(ValueError) body, but neither name starts with test_ so pytest never collects them and nothing else calls them. tests/datetime/test_start_end_of.py goes from 48 to 50 passed. Replacing "invalid" with a real unit fails the renamed test, which confirms the pytest.raises block is now doing the work. tests/datetime: 573 passed. --- tests/datetime/test_start_end_of.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/datetime/test_start_end_of.py b/tests/datetime/test_start_end_of.py index 1937e74da..f517b3284 100644 --- a/tests/datetime/test_start_end_of.py +++ b/tests/datetime/test_start_end_of.py @@ -259,12 +259,12 @@ def test_average_from_lower(): assert_datetime(d2, 2004, 12, 31, 12, 30, 30) -def start_of_with_invalid_unit(): +def test_start_of_with_invalid_unit(): with pytest.raises(ValueError): pendulum.now().start_of("invalid") -def end_of_with_invalid_unit(): +def test_end_of_with_invalid_unit(): with pytest.raises(ValueError): pendulum.now().end_of("invalid")