Skip to content

Commit

Permalink
Be consistent in identifying method names for subtests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ubernostrum committed Nov 20, 2023
1 parent 4ad17dc commit 89e9c3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tests/test_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand All @@ -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"):
Expand All @@ -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"):
Expand All @@ -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"):
Expand Down
8 changes: 4 additions & 4 deletions tests/test_sync_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand All @@ -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"):
Expand All @@ -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"):
Expand All @@ -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"):
Expand Down

0 comments on commit 89e9c3d

Please sign in to comment.