mirror of
https://github.com/andrewthetechie/py-healthchecks.io.git
synced 2026-04-21 22:42:40 +02:00
fixes for mypy and xdoctest
This commit is contained in:
@@ -8,7 +8,7 @@ Context Manager
|
||||
|
||||
Either the Client or AsyncClient can be used as a ContextManager (or Async Context Manager)
|
||||
|
||||
.. code-block:: pythong
|
||||
.. code-block:: python
|
||||
|
||||
from healthchecks_io import AsyncClient, CheckCreate
|
||||
|
||||
@@ -82,6 +82,7 @@ Pinging a Check
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from healthchecks_io import Client
|
||||
|
||||
client = Client(api_key="myapikey")
|
||||
|
||||
@@ -153,13 +153,14 @@ class CheckTrap:
|
||||
Optional[bool]: self.suppress_exceptions, if true will not raise any exceptions
|
||||
"""
|
||||
if exc_type is None:
|
||||
await self.client.success_ping(
|
||||
# ignore typing, if we've gotten here we know its an async client
|
||||
await self.client.success_ping( # type: ignore
|
||||
self.uuid, self.slug, data="\n".join(self.log_lines)
|
||||
)
|
||||
else:
|
||||
self.add_log(str(exc))
|
||||
self.add_log(str(traceback))
|
||||
await self.client.fail_ping(
|
||||
await self.client.fail_ping( # type: ignore
|
||||
self.uuid, self.slug, data="\n".join(self.log_lines)
|
||||
)
|
||||
return self.suppress_exceptions
|
||||
|
||||
Reference in New Issue
Block a user