Skip to content

Commit 37cc165

Browse files
committed
fixes test
1 parent 0bbeccd commit 37cc165

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

tests/providers/test_garmin.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,18 +299,15 @@ def test_fetch_activities_for_month_december(self):
299299
mock_client.get_activities_by_date.assert_called_once_with("2021-12-01", "2021-12-31")
300300

301301
def test_fetch_activities_api_error(self):
302-
"""Test handling of API errors during fetch."""
302+
"""Test that connection errors propagate so the worker can surface them."""
303303
provider = GarminProvider()
304304

305-
# Mock client to raise a Garmin-specific exception
306305
mock_client = Mock()
307306
mock_client.get_activities_by_date.side_effect = GarminConnectConnectionError("API Error")
308307
provider._get_client = Mock(return_value=mock_client)
309308

310-
result = provider.fetch_activities_for_month("2021-01")
311-
312-
# Should return empty list on error
313-
assert result == []
309+
with pytest.raises(GarminConnectConnectionError):
310+
provider.fetch_activities_for_month("2021-01")
314311

315312

316313
class TestGarminProviderGear:

0 commit comments

Comments
 (0)