From 89e9c3d501746321fa36945683020cb551c8b8dd Mon Sep 17 00:00:00 2001 From: James Bennett Date: Sun, 19 Nov 2023 22:14:18 -0800 Subject: [PATCH] Be consistent in identifying method names for subtests. --- tests/test_async_client.py | 8 ++++---- tests/test_sync_client.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_async_client.py b/tests/test_async_client.py index 8ad3cf4..c1f3782 100644 --- a/tests/test_async_client.py +++ b/tests/test_async_client.py @@ -362,7 +362,7 @@ async def test_error_status(self): config=self.config, http_client=self.custom_response_async_client(status_code=code), ) - with self.subTest(): + with self.subTest(method="verify_key"): with self.assertRaises(akismet.RequestError): await client.verify_key(self.config.key, self.config.url) for method in ("comment_check", "submit_ham", "submit_spam"): @@ -386,7 +386,7 @@ async def test_error_timeout(self): httpx.TimeoutException, "Timed out." ), ) - with self.subTest(): + with self.subTest(method="verify_key"): with self.assertRaises(akismet.RequestError): await client.verify_key(self.config.key, self.config.url) for method in ("comment_check", "submit_ham", "submit_spam"): @@ -407,7 +407,7 @@ async def test_error_other_httpx(self): config=self.config, http_client=self.exception_async_client(httpx.RequestError), ) - with self.subTest(): + with self.subTest(method="verify_key"): with self.assertRaises(akismet.RequestError): await client.verify_key(self.config.key, self.config.url) for method in ("comment_check", "submit_ham", "submit_spam"): @@ -429,7 +429,7 @@ async def test_error_other(self): config=self.config, http_client=self.exception_async_client(TypeError), ) - with self.subTest(): + with self.subTest(method="verify_key"): with self.assertRaises(akismet.RequestError): await client.verify_key(self.config.key, self.config.url) for method in ("comment_check", "submit_ham", "submit_spam"): diff --git a/tests/test_sync_client.py b/tests/test_sync_client.py index e3390ac..76f9b5e 100644 --- a/tests/test_sync_client.py +++ b/tests/test_sync_client.py @@ -362,7 +362,7 @@ def test_error_status(self): config=self.config, http_client=self.custom_response_sync_client(status_code=code), ) - with self.subTest(): + with self.subTest(method="verify_key"): with self.assertRaises(akismet.RequestError): client.verify_key(self.config.key, self.config.url) for method in ("comment_check", "submit_ham", "submit_spam"): @@ -386,7 +386,7 @@ def test_error_timeout(self): httpx.TimeoutException, "Timed out." ), ) - with self.subTest(): + with self.subTest(method="verify_key"): with self.assertRaises(akismet.RequestError): client.verify_key(self.config.key, self.config.url) for method in ("comment_check", "submit_ham", "submit_spam"): @@ -407,7 +407,7 @@ def test_error_other_httpx(self): config=self.config, http_client=self.exception_sync_client(httpx.RequestError), ) - with self.subTest(): + with self.subTest(method="verify_key"): with self.assertRaises(akismet.RequestError): client.verify_key(self.config.key, self.config.url) for method in ("comment_check", "submit_ham", "submit_spam"): @@ -429,7 +429,7 @@ def test_error_other(self): config=self.config, http_client=self.exception_sync_client(TypeError), ) - with self.subTest(): + with self.subTest(method="verify_key"): with self.assertRaises(akismet.RequestError): client.verify_key(self.config.key, self.config.url) for method in ("comment_check", "submit_ham", "submit_spam"):