Skip to content

Commit 5b3e53d

Browse files
committed
Change check for whether extras are installed
1 parent 67a947b commit 5b3e53d

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

tests/test_examples.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,15 @@
4343

4444
from .conftest import ClientWithHandler, TestEnv, try_import
4545

46-
try:
47-
from pydantic_ai.providers.google import GoogleProvider
48-
except ImportError: # pragma: lax no cover
49-
GoogleProvider = None
50-
51-
52-
try:
53-
import logfire
54-
except ImportError: # pragma: lax no cover
55-
logfire = None
56-
57-
5846
with try_import() as imports_successful:
47+
# We check whether pydantic_ai_examples is importable as a proxy for whether all extras are installed, as some docs examples require them
48+
import pydantic_ai_examples # noqa: F401
49+
5950
from pydantic_evals.reporting import EvaluationReport
6051

6152

6253
pytestmark = [
6354
pytest.mark.skipif(not imports_successful(), reason='extras not installed'),
64-
pytest.mark.skipif(logfire is None or GoogleProvider is None, reason='logfire or google-provider not installed'),
6555
]
6656
code_examples: dict[str, CodeExample] = {}
6757

0 commit comments

Comments
 (0)