From 0348282e7021e3bb618e40488f0b7d557a4cc77f Mon Sep 17 00:00:00 2001 From: Thomas Pelletier Date: Mon, 19 Feb 2024 15:07:45 -0500 Subject: [PATCH] Fix invalid escape sequence in client test regexps 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. --- tests/test_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index aa2e22bd..c3b46d2b 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -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)]) @@ -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)])