Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
isahers1 committed Jan 29, 2025
1 parent 0ac755e commit 03d0c4b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ integration_tests:
poetry run python -m pytest -x -v --durations=10 --cov=langsmith --cov-report=term-missing --cov-report=html --cov-config=.coveragerc tests/integration_tests

integration_tests_fast:
poetry run python -m pytest -s -x -n auto --durations=10 -v --cov=langsmith --cov-report=term-missing --cov-report=html --cov-config=.coveragerc tests/integration_tests
poetry run python -m pytest -x -n auto --durations=10 -v --cov=langsmith --cov-report=term-missing --cov-report=html --cov-config=.coveragerc tests/integration_tests

doctest:
poetry run python -m pytest -n auto -x --durations=10 --doctest-modules langsmith
Expand Down
2 changes: 0 additions & 2 deletions python/langsmith/run_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,6 @@ def _setup_run(
kwargs: Any = None,
) -> _TraceableContainer:
"""Create a new run or create_child() if run is passed in kwargs."""
print("SETTING UP RUN", utils.tracing_is_enabled())
extra_outer = container_input.get("extra_outer") or {}
metadata = container_input.get("metadata")
tags = container_input.get("tags")
Expand Down Expand Up @@ -1442,7 +1441,6 @@ def _setup_run(
)
if utils.tracing_is_enabled() is True:
try:
print("POSTING RUN")
new_run.post()
except BaseException as e:
LOGGER.error(f"Failed to post run {new_run.id}: {e}")
Expand Down
25 changes: 13 additions & 12 deletions python/tests/integration_tests/wrappers/test_anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from langsmith import Client
from langsmith.wrappers import wrap_anthropic
import langsmith.schemas as ls_schemas
from tests.unit_tests.test_run_helpers import _get_calls

model_name = "claude-3-haiku-20240307"
Expand Down Expand Up @@ -140,10 +141,10 @@ async def test_chat_async_api(stream: bool):
)

time.sleep(1)
assert mock_session.return_value.request.call_count > 1
assert mock_session.request.call_count > 1
# This is the info call
assert mock_session.return_value.request.call_args_list[0][0][0].upper() == "GET"
for call in mock_session.return_value.request.call_args_list[1:]:
assert mock_session.request.call_args_list[0][0][0].upper() == "GET"
for call in mock_session.request.call_args_list[1:]:
assert call[0][0].upper() == "POST"


Expand Down Expand Up @@ -184,10 +185,10 @@ def test_completions_sync_api(stream: bool):
assert original.completion == patched.completion

time.sleep(1)
assert mock_session.return_value.request.call_count > 1
assert mock_session.request.call_count > 1
# This is the info call
assert mock_session.return_value.request.call_args_list[0][0][0].upper() == "GET"
for call in mock_session.return_value.request.call_args_list[1:]:
assert mock_session.request.call_args_list[0][0][0].upper() == "GET"
for call in mock_session.request.call_args_list[1:]:
assert call[0][0].upper() == "POST"


Expand Down Expand Up @@ -228,10 +229,10 @@ async def test_completions_async_api(stream: bool):
assert original.completion == patched.completion

time.sleep(1)
assert mock_session.return_value.request.call_count > 1
assert mock_session.request.call_count > 1
# This is the info call
assert mock_session.return_value.request.call_args_list[0][0][0].upper() == "GET"
for call in mock_session.return_value.request.call_args_list[1:]:
assert mock_session.request.call_args_list[0][0][0].upper() == "GET"
for call in mock_session.request.call_args_list[1:]:
assert call[0][0].upper() == "POST"


Expand Down Expand Up @@ -308,8 +309,8 @@ async def test_beta_chat_async_api():
)

time.sleep(1)
assert mock_session.return_value.request.call_count > 1
assert mock_session.request.call_count > 1
# This is the info call
assert mock_session.return_value.request.call_args_list[0][0][0].upper() == "GET"
for call in mock_session.return_value.request.call_args_list[1:]:
assert mock_session.request.call_args_list[0][0][0].upper() == "GET"
for call in mock_session.request.call_args_list[1:]:
assert call[0][0].upper() == "POST"

0 comments on commit 03d0c4b

Please sign in to comment.