Skip to content

Conversation

@caua1503
Copy link
Contributor

@caua1503 caua1503 commented Sep 7, 2025

This PR adds async support to the library using HTTPX.

  • Implementation of async clients
  • Added async tests based on existing sync tests
  • Maintains compatibility with the synchronous client

I expect to have covered all test scenarios.

- Renomeia AbacatePay para AbacatePayClient

- Cria função AbacatePay(api_key, async_mode=False) que retorna
  AbacatePayClient por padrão ou AbacatePayAsyncClient quando async_mode=True

- Permite suporte a operações assíncronas sem quebrar código existente
- Implementa client assíncrono base para requisições HTTP
- Base para futuras classes que precisam de operações async
- Adiciona dependências para testes assíncronos
- Implementa testes usando respx para simular chamadas HTTP
… erros JSON

- Adiciona `RequestType = Union[requests.Request, httpx.Request]`
  e `ResponseType = Union[requests.Response, httpx.Response]` em todas
  funções de tratamento de erro

- Permite compatibilidade entre requests e HTTPX
- Melhora tratamento de respostas JSON inválidas ou malformadas
- Duplicates existing synchronous client tests
- Ensures billing functionalities work correctly in async mode
…ix QR codes

- Adds `BillingAsyncClient`, `CustomerAsyncClient`, `CouponAsyncClient`, and `PixQrCodeAsyncClient`
- Implements unit tests for BaseAsyncClient
- Follows the same structure and test coverage as BaseClient
- Adds `STATUS_TO_EXCEPTION` for parametrizing status codes and exceptions using `pytest.mark.parametrize`
- Implements authentication tests for async clients
- Adds tests for customers
- Adapts existing synchronous test logic to async version
- Uses Literal together with @overload
- Provides stricter and safer typing at development time
- Replaces deprecated [tool.poetry.dev-dependencies]
- Ensures compatibility with future Poetry versions
Add pytest-asyncio
@JoaquimCassano
Copy link
Member

Lgtm

@JoaquimCassano JoaquimCassano merged commit 4ee9f22 into AbacatePay:main Sep 8, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants