Surface programming errors in user fetches
ci / push-image (push) Successful in 1m14s
ci / deploy-coolify (push) Successful in 7s
ci / test (push) Successful in 36s

This commit is contained in:
Space-Banane
2026-06-04 22:56:11 +02:00
parent c622420e38
commit c94bc7e5d4
2 changed files with 20 additions and 1 deletions
+19
View File
@@ -65,6 +65,25 @@ async def test_fetch_source_usernames_skips_failed_accounts() -> None:
assert stale is False
@pytest.mark.asyncio
async def test_fetch_source_usernames_does_not_swallow_programming_errors() -> None:
def broken_fetcher(username):
async def fetch():
raise TypeError("bad shape")
return fetch
with pytest.raises(TypeError, match="bad shape"):
await _fetch_source_usernames(
None,
"github",
["octocat", "hubot"],
date(2026, 1, 1),
date(2026, 1, 1),
broken_fetcher,
)
@pytest.mark.asyncio
async def test_fetch_source_usernames_keeps_cache_after_username_list_changes() -> None:
with tempfile.TemporaryDirectory(dir=Path.cwd()) as temp_dir: