Skip to content

Commit

Permalink
Use blockbuster to detect blocking calls
Browse files Browse the repository at this point in the history
  • Loading branch information
cbornet committed Nov 25, 2024
1 parent ab67b61 commit b8b2779
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
28 changes: 26 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pytest-httpserver = "~1.0.8"
testcontainers = "~3.7.1"
ruff = "^0.6.8"
types-toml = "^0.10.8.7"
blockbuster = "^1.1.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
8 changes: 8 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@

import functools
import warnings
from collections.abc import Iterator
from typing import Any, Awaitable, Callable, TypedDict

import pytest
from blockbuster import BlockBuster, blockbuster_ctx
from deprecation import UnsupportedWarning

from astrapy import DataAPIClient
Expand Down Expand Up @@ -51,6 +53,12 @@
)


@pytest.fixture(autouse=True)
def blockbuster() -> Iterator[BlockBuster]:
with blockbuster_ctx() as bb:
yield bb


class DataAPICredentials(TypedDict):
token: str | TokenProvider
api_endpoint: str
Expand Down

0 comments on commit b8b2779

Please sign in to comment.