Skip to content

Commit dd57957

Browse files
authored
ci: Fix pydantic-ai-slim job skipping all tests (#2704)
1 parent 10339bb commit dd57957

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

docs/graph.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ stateDiagram-v2
352352
Feedback --> [*]
353353
```
354354

355-
```python {title="genai_email_feedback.py" py="3.10" test="ci_only"}
355+
```python {title="genai_email_feedback.py" py="3.10"}
356356
from __future__ import annotations as _annotations
357357

358358
from dataclasses import dataclass, field
@@ -384,7 +384,7 @@ class State:
384384

385385

386386
email_writer_agent = Agent(
387-
'google-vertex:gemini-1.5-pro',
387+
'google-gla:gemini-1.5-pro',
388388
output_type=Email,
389389
system_prompt='Write a welcome email to our tech blog.',
390390
)

docs/models/google.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ To use Vertex AI, you may need to set up [application default credentials](https
6161

6262
If you have the [`gcloud` CLI](https://cloud.google.com/sdk/gcloud) installed and configured, you can use:
6363

64-
```python {test="ci_only"}
64+
```python {test="skip"}
6565
from pydantic_ai import Agent
6666
from pydantic_ai.models.google import GoogleModel
6767
from pydantic_ai.providers.google import GoogleProvider

pydantic_ai_slim/pydantic_ai/models/mistral.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
from mistralai.models.usermessage import UserMessage as MistralUserMessage
8080
from mistralai.types.basemodel import Unset as MistralUnset
8181
from mistralai.utils.eventstreaming import EventStreamAsync as MistralEventStreamAsync
82-
except ImportError as e: # pragma: no cover
82+
except ImportError as e:
8383
raise ImportError(
8484
'Please install `mistral` to use the Mistral model, '
8585
'you can use the `mistral` optional group — `pip install "pydantic-ai-slim[mistral]"`'

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ def bedrock_provider():
414414
pytest.skip('boto3 is not installed')
415415

416416

417-
@pytest.fixture(autouse=True)
417+
@pytest.fixture()
418418
def vertex_provider_auth(mocker: MockerFixture) -> None: # pragma: lax no cover
419419
# Locally, we authenticate via `gcloud` CLI, so we don't need to patch anything.
420420
if not os.getenv('CI', False):
@@ -440,7 +440,7 @@ def expired(self) -> bool:
440440

441441

442442
@pytest.fixture()
443-
async def vertex_provider(): # pragma: lax no cover
443+
async def vertex_provider(vertex_provider_auth: None): # pragma: lax no cover
444444
# NOTE: You need to comment out this line to rewrite the cassettes locally.
445445
if not os.getenv('CI', False):
446446
pytest.skip('Requires properly configured local google vertex config to pass')

tests/models/test_google.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,9 +1113,10 @@ async def test_google_url_input(
11131113
not os.getenv('CI', False), reason='Requires properly configured local google vertex config to pass'
11141114
)
11151115
@pytest.mark.vcr()
1116-
async def test_google_url_input_force_download(allow_model_requests: None) -> None: # pragma: lax no cover
1117-
provider = GoogleProvider(project='pydantic-ai', location='us-central1')
1118-
m = GoogleModel('gemini-2.0-flash', provider=provider)
1116+
async def test_google_url_input_force_download(
1117+
allow_model_requests: None, vertex_provider: GoogleProvider
1118+
) -> None: # pragma: lax no cover
1119+
m = GoogleModel('gemini-2.0-flash', provider=vertex_provider)
11191120
agent = Agent(m)
11201121

11211122
video_url = VideoUrl(url='https://data.grepit.app/assets/tiny_video.mp4', force_download=True)

0 commit comments

Comments
 (0)