Skip to content

Commit 01ac735

Browse files
committed
fix: test setup needs all three access keys
1 parent da88e9e commit 01ac735

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

tests/conftest.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
from gradient._utils import is_dict
1515

1616
if TYPE_CHECKING:
17-
from _pytest.fixtures import FixtureRequest # pyright: ignore[reportPrivateImportUsage]
17+
from _pytest.fixtures import (
18+
FixtureRequest,
19+
) # pyright: ignore[reportPrivateImportUsage]
1820

1921
pytest.register_assert_rewrite("tests.utils")
2022

@@ -46,6 +48,8 @@ def pytest_collection_modifyitems(items: list[pytest.Function]) -> None:
4648
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
4749

4850
access_token = "My Access Token"
51+
model_access_key = "My Model Access Key"
52+
agent_access_key = "My Agent Access Key"
4953

5054

5155
@pytest.fixture(scope="session")
@@ -54,7 +58,13 @@ def client(request: FixtureRequest) -> Iterator[Gradient]:
5458
if not isinstance(strict, bool):
5559
raise TypeError(f"Unexpected fixture parameter type {type(strict)}, expected {bool}")
5660

57-
with Gradient(base_url=base_url, access_token=access_token, _strict_response_validation=strict) as client:
61+
with Gradient(
62+
base_url=base_url,
63+
access_token=access_token,
64+
model_access_key=model_access_key,
65+
agent_access_key=agent_access_key,
66+
_strict_response_validation=strict,
67+
) as client:
5868
yield client
5969

6070

@@ -79,6 +89,11 @@ async def async_client(request: FixtureRequest) -> AsyncIterator[AsyncGradient]:
7989
raise TypeError(f"Unexpected fixture parameter type {type(param)}, expected bool or dict")
8090

8191
async with AsyncGradient(
82-
base_url=base_url, access_token=access_token, _strict_response_validation=strict, http_client=http_client
92+
base_url=base_url,
93+
access_token=access_token,
94+
model_access_key=model_access_key,
95+
agent_access_key=agent_access_key,
96+
_strict_response_validation=strict,
97+
http_client=http_client,
8398
) as client:
8499
yield client

0 commit comments

Comments
 (0)