mirror of
https://github.com/andrewthetechie/py-healthchecks.io.git
synced 2026-04-20 22:12:41 +02:00
feat: add python 3.11 support (#392)
* feat: add python 3.11 support - adds testing for python 3.11 - moves from black and flake8 to ruff for linting - Updates coverage output from tests * fix: fix dev dependency group * fix: add installing dev dependencies * ci: add toml * ci: simplify coverage * ci: update coverage
This commit is contained in:
@@ -10,7 +10,6 @@ from healthchecks_io import HCAPIAuthError
|
||||
from healthchecks_io import HCAPIError
|
||||
from healthchecks_io import HCAPIRateLimitError
|
||||
from healthchecks_io import NonUniqueSlugError
|
||||
from healthchecks_io.client._abstract import AbstractClient
|
||||
|
||||
|
||||
def test_abstract_add_url_params(test_abstract_client):
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from urllib.parse import urljoin
|
||||
|
||||
import pytest
|
||||
import respx
|
||||
from httpx import AsyncClient as HTTPXAsyncClient
|
||||
from httpx import Response
|
||||
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
from urllib.parse import urljoin
|
||||
|
||||
import pytest
|
||||
import respx
|
||||
from httpx import Client as HTTPXClient
|
||||
from httpx import Response
|
||||
|
||||
from healthchecks_io import CheckCreate
|
||||
from healthchecks_io import CheckTrap
|
||||
from healthchecks_io import CheckUpdate
|
||||
from healthchecks_io import PingFailedError
|
||||
from healthchecks_io import WrongClientError
|
||||
|
||||
@@ -19,7 +15,7 @@ def test_check_trap_sync(respx_mock, test_client):
|
||||
success_url = urljoin(test_client._ping_url, "test")
|
||||
respx_mock.post(success_url).mock(return_value=Response(status_code=200, text="OK"))
|
||||
|
||||
with CheckTrap(test_client, uuid="test") as ct:
|
||||
with CheckTrap(test_client, uuid="test"):
|
||||
pass
|
||||
|
||||
|
||||
@@ -28,7 +24,7 @@ def test_check_trap_sync_failed_ping(respx_mock, test_client):
|
||||
start_url = urljoin(test_client._ping_url, "test/start")
|
||||
respx_mock.post(start_url).mock(return_value=Response(status_code=444, text="OK"))
|
||||
with pytest.raises(PingFailedError):
|
||||
with CheckTrap(test_client, uuid="test") as ct:
|
||||
with CheckTrap(test_client, uuid="test"):
|
||||
pass
|
||||
|
||||
|
||||
@@ -39,7 +35,7 @@ def test_check_trap_sync_exception(respx_mock, test_client):
|
||||
fail_url = urljoin(test_client._ping_url, "test/fail")
|
||||
respx_mock.post(fail_url).mock(return_value=Response(status_code=200, text="OK"))
|
||||
with pytest.raises(Exception):
|
||||
with CheckTrap(test_client, uuid="test") as ct:
|
||||
with CheckTrap(test_client, uuid="test"):
|
||||
raise Exception("Exception")
|
||||
|
||||
|
||||
@@ -51,7 +47,7 @@ async def test_check_trap_async(respx_mock, test_async_client):
|
||||
success_url = urljoin(test_async_client._ping_url, "test")
|
||||
respx_mock.post(success_url).mock(return_value=Response(status_code=200, text="OK"))
|
||||
|
||||
async with CheckTrap(test_async_client, uuid="test") as ct:
|
||||
async with CheckTrap(test_async_client, uuid="test"):
|
||||
pass
|
||||
|
||||
|
||||
@@ -61,7 +57,7 @@ async def test_check_trap_async_failed_ping(respx_mock, test_async_client):
|
||||
start_url = urljoin(test_async_client._ping_url, "test/start")
|
||||
respx_mock.post(start_url).mock(return_value=Response(status_code=444, text="OK"))
|
||||
with pytest.raises(PingFailedError):
|
||||
async with CheckTrap(test_async_client, uuid="test") as ct:
|
||||
async with CheckTrap(test_async_client, uuid="test"):
|
||||
pass
|
||||
|
||||
|
||||
@@ -74,7 +70,7 @@ async def test_check_trap_async_exception(respx_mock, test_async_client):
|
||||
respx_mock.post(fail_url).mock(return_value=Response(status_code=200, text="OK"))
|
||||
|
||||
with pytest.raises(Exception):
|
||||
async with CheckTrap(test_async_client, uuid="test") as ct:
|
||||
async with CheckTrap(test_async_client, uuid="test"):
|
||||
raise Exception("Exception")
|
||||
|
||||
|
||||
@@ -82,11 +78,11 @@ async def test_check_trap_async_exception(respx_mock, test_async_client):
|
||||
async def test_check_trap_wrong_client_error(test_client, test_async_client):
|
||||
|
||||
with pytest.raises(WrongClientError):
|
||||
async with CheckTrap(test_client, uuid="test") as ct:
|
||||
async with CheckTrap(test_client, uuid="test"):
|
||||
pass
|
||||
|
||||
with pytest.raises(WrongClientError):
|
||||
with CheckTrap(test_async_client, uuid="test") as ct:
|
||||
with CheckTrap(test_async_client, uuid="test"):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from urllib.parse import urljoin
|
||||
|
||||
import pytest
|
||||
import respx
|
||||
from httpx import Client as HTTPXClient
|
||||
from httpx import Response
|
||||
|
||||
|
||||
Reference in New Issue
Block a user