Skip to content

Commit

Permalink
fix(py): Fix output_keys (#1498)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 authored Feb 8, 2025
1 parent fd33f5a commit 46f58be
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions python/langsmith/testing/_internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,8 @@ def __init__(
self.pytest_plugin = pytest_plugin
self.pytest_nodeid = pytest_nodeid
self._logged_reference_outputs: Optional[dict] = None
self.inputs = inputs
self.reference_outputs = reference_outputs

if pytest_plugin and pytest_nodeid:
pytest_plugin.add_process_to_test_suite(
Expand Down Expand Up @@ -866,16 +868,14 @@ def _run_test(
langtest_extra=langtest_extra,
)
_TEST_CASE.set(test_case)
func_sig = inspect.signature(func)
func_inputs = rh._get_inputs_safe(func_sig, *test_args, **test_kwargs)

def _test():
test_case.start_time()
with rh.trace(
name=getattr(func, "__name__", "Test"),
run_id=test_case.run_id,
reference_example_id=test_case.example_id,
inputs=func_inputs,
inputs=test_case.inputs,
project_name=test_case.test_suite.name,
exceptions_to_handle=(SkipException,),
_end_on_exit=False,
Expand Down Expand Up @@ -936,16 +936,14 @@ async def _arun_test(
langtest_extra=langtest_extra,
)
_TEST_CASE.set(test_case)
func_sig = inspect.signature(func)
func_inputs = rh._get_inputs_safe(func_sig, *test_args, **test_kwargs)

async def _test():
test_case.start_time()
with rh.trace(
name=getattr(func, "__name__", "Test"),
run_id=test_case.run_id,
reference_example_id=test_case.example_id,
inputs=func_inputs,
inputs=test_case.inputs,
project_name=test_case.test_suite.name,
exceptions_to_handle=(SkipException,),
_end_on_exit=False,
Expand Down

0 comments on commit 46f58be

Please sign in to comment.