Skip to content

Commit b292e82

Browse files
committed
typing test fix
1 parent 50c0bc3 commit b292e82

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • py/src/braintrust/wrappers/pytest_plugin

py/src/braintrust/wrappers/pytest_plugin/plugin.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
from __future__ import annotations
1111

1212
import traceback
13-
from typing import Any
13+
from typing import TYPE_CHECKING, Any
1414

1515
import pytest
16-
from braintrust.logger import NOOP_SPAN, Span
16+
17+
if TYPE_CHECKING:
18+
from braintrust.logger import Span
1719

1820
# ---------------------------------------------------------------------------
1921
# Marker registration & CLI options (always active)
@@ -86,6 +88,8 @@ def braintrust_span(request: pytest.FixtureRequest) -> Span:
8688
When ``--braintrust`` is not active the fixture returns a no-op span
8789
that silently discards all logged data.
8890
"""
91+
from braintrust.logger import NOOP_SPAN
92+
8993
return getattr(request.node, "_braintrust_span", NOOP_SPAN)
9094

9195

0 commit comments

Comments
 (0)