-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python[minor]: pytest integration #1362
Conversation
I like the functionality. I kinda like using a single module/object to access the methods, like
or something |
This comment was marked as outdated.
This comment was marked as outdated.
I like |
This comment was marked as outdated.
This comment was marked as outdated.
why is it "reference" input vs target, expect, etc |
pytest_nodeid=pytest_nodeid, | ||
) | ||
|
||
def _end_run( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs review, very open to less hacky ideas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't think of any great solutions right now without async. Would add a detailed comment about this and address later as a TODO
|
||
@warn_beta | ||
@contextlib.contextmanager | ||
def trace_feedback( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worth review
) | ||
|
||
|
||
def _run_test( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worth review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks reasonable to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just one main comment
def end_run( | ||
self, run_tree, example_id, outputs, pytest_plugin=None, pytest_nodeid=None | ||
) -> Future: | ||
return self._executor.submit( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to submit this in an executor? run_tree.patch
calls update_run
which is async already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to not block on the self.wait_example_updates(example_id) call
pytest_nodeid=pytest_nodeid, | ||
) | ||
|
||
def _end_run( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't think of any great solutions right now without async. Would add a detailed comment about this and address later as a TODO
) | ||
|
||
|
||
def _run_test( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks reasonable to me
Log pytest tests to LangSmith. Useful for:
Install
pip install "langsmith[pytest]==0.2.11rc14"
Simple usage
Run
pytest --outputs='ls' tests/test_foo.py
Results
Advanced usage
Run using pytest-xdist to parallelize (
pip install pytest-xdist first
)Results: https://dev.smith.langchain.com/public/cea0e7fd-2d27-47d1-8ada-141069acdf0d/d