Skip to content

Commit

Permalink
Fix invalid escape sequence in client test regexps
Browse files Browse the repository at this point in the history
The original error printed by mypy:

```
tests/test_client.py:29: SyntaxWarning: invalid escape sequence '\('
  "Dispatch received an invalid authentication token \(check DISPATCH_API_KEY is correct\)",
tests/test_client.py:40: SyntaxWarning: invalid escape sequence '\('
  "Dispatch received an invalid authentication token \(check api_key is correct\)",
```

Luckily in python all unrecognized escape sequences are left in the string
unchanged, so it still worked.
  • Loading branch information
pelletier committed Feb 19, 2024
1 parent b5931bd commit 0348282
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_api_key_from_env(self):

with self.assertRaisesRegex(
PermissionError,
"Dispatch received an invalid authentication token \(check DISPATCH_API_KEY is correct\)",
r"Dispatch received an invalid authentication token \(check DISPATCH_API_KEY is correct\)",
) as mc:
client.dispatch([Call(function="my-function", input=42)])

Expand All @@ -37,7 +37,7 @@ def test_api_key_from_arg(self):

with self.assertRaisesRegex(
PermissionError,
"Dispatch received an invalid authentication token \(check api_key is correct\)",
r"Dispatch received an invalid authentication token \(check api_key is correct\)",
) as mc:
client.dispatch([Call(function="my-function", input=42)])

Expand Down

0 comments on commit 0348282

Please sign in to comment.