1- # load environment variables from a .env file for local testing
2- from dotenv import load_dotenv
3-
4- load_dotenv ()
5-
6- from collections .abc import AsyncGenerator # noqa: E402
7-
8- import pytest # noqa: E402
9-
10- from bubble_data_api_client import configure , settings # noqa: E402
11- from bubble_data_api_client .client import raw_client # noqa: E402
12- from bubble_data_api_client .pool import close_clients # noqa: E402
1+ import pytest
132
143
154@pytest .fixture
@@ -20,35 +9,3 @@ def test_url() -> str:
209@pytest .fixture
2110def test_api_key () -> str :
2211 return "123"
23-
24-
25- @pytest .fixture (autouse = True )
26- async def auto_configure_client () -> AsyncGenerator [None ]:
27- """Automatically configure the client for every test run."""
28- if not settings .BUBBLE_DATA_API_ROOT_URL :
29- raise RuntimeError ("BUBBLE_DATA_API_ROOT_URL" )
30- if not settings .BUBBLE_API_KEY :
31- raise RuntimeError ("BUBBLE_API_KEY" )
32-
33- configure (
34- data_api_root_url = settings .BUBBLE_DATA_API_ROOT_URL ,
35- api_key = settings .BUBBLE_API_KEY ,
36- )
37-
38- yield
39-
40- await close_clients ()
41-
42-
43- @pytest .fixture
44- async def bubble_raw_client () -> AsyncGenerator [raw_client .RawClient ]:
45- """Provide a raw client for testing the low-level API."""
46- async with raw_client .RawClient () as client_instance :
47- yield client_instance
48-
49-
50- @pytest .fixture
51- def typename () -> str :
52- """Return a test typename for integration tests."""
53- # this typename should exist in the bubble app and should allow CRUD operations
54- return "IntegrationTest"
0 commit comments