Surface programming errors in user fetches
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user