-
Notifications
You must be signed in to change notification settings - Fork 52
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
[Tool Test] Add test for tools #273
Conversation
@@ -3,3 +3,6 @@ pytest == 7.4.2 | |||
pytest-asyncio | |||
pytest-cov | |||
uvicorn | |||
pymupdf |
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.
ScraperTool 的有依赖这几个
@@ -36,11 +36,11 @@ def avaliable_free_port(self, exclude=None): | |||
raise ValueError("can not get valiable port in [8000, 8200]") | |||
|
|||
def setUp(self) -> None: | |||
from multiprocessing import Process | |||
from threading import Thread |
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.
用线程额方式来测试,否则单测覆盖率检测不到子进程中的代码覆盖情况
|
||
class Config: | ||
use_enum_values = True | ||
model_config = ConfigDict(use_enum_values=True) |
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.
pydantic 2.0 里面已经不推荐 config-class base 的配置方法,所以调整了。
from langchain_community.document_loaders import PyMuPDFLoader | ||
from langchain_community.retrievers import ArxivRetriever |
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.
这个应该是比较近期的改动。需要在我们的requirements.txt里面加入对于langchain >= 拆分后的版本吗?
check_json_length(fake_json_data) | ||
|
||
|
||
def test_tool_string_format(): |
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.
这个测试和remote toolkit没啥关系呀
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #273 +/- ##
===========================================
+ Coverage 69.37% 72.15% +2.78%
===========================================
Files 63 63
Lines 3236 3229 -7
===========================================
+ Hits 2245 2330 +85
+ Misses 991 899 -92 ☔ View full report in Codecov by Sentry. |
print(cur_time) | ||
print(tool) |
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.
删
No description provided.