Skip to content

Commit

Permalink
test: Make RE match a raw string
Browse files Browse the repository at this point in the history
Fixes new warning with ruff 0.8.6:

> test/test_aio.py:146:59: RUF043 Pattern passed to `match=` contains metacharacters but is neither escaped nor raw
  • Loading branch information
martinpitt authored and jelly committed Feb 9, 2025
1 parent 00c69d6 commit 0db58ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test_aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ async def api(service: GitHubService) -> AsyncIterator[GitHub]:
async def test_github_404(service: GitHubService, api: GitHub) -> None:
# Make sure 4xx errors get raised immediately without retries
service.add('x', status=404, reason='Not Found')
with pytest.raises(aiohttp.ClientResponseError, match='404.*Not Found'):
with pytest.raises(aiohttp.ClientResponseError, match=r'404.*Not Found'):
assert await api.get('x') == {}
service.assert_hits(1, 1)

Expand Down

0 comments on commit 0db58ac

Please sign in to comment.