mirror of
https://github.com/xtekky/gpt4free.git
synced 2026-04-22 15:47:11 +08:00
feat: Add YAML import check and skip tests if not available
This commit is contained in:
@@ -22,6 +22,7 @@ from g4f.providers.config_provider import (
|
||||
RouterConfig,
|
||||
ConfigModelProvider,
|
||||
evaluate_condition,
|
||||
has_yaml
|
||||
)
|
||||
|
||||
|
||||
@@ -271,6 +272,8 @@ class TestEvaluateCondition(unittest.TestCase):
|
||||
class TestRouterConfig(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
if not has_yaml:
|
||||
self.skipTest('"yaml" not installed')
|
||||
RouterConfig.clear()
|
||||
|
||||
def test_load_valid_yaml(self):
|
||||
|
||||
@@ -18,4 +18,5 @@ markitdown[all]
|
||||
a2wsgi
|
||||
python-dotenv
|
||||
ddgs
|
||||
cloudscraper
|
||||
cloudscraper
|
||||
yaml
|
||||
+2
-1
@@ -20,4 +20,5 @@ python-dotenv
|
||||
ddgs
|
||||
cloudscraper
|
||||
wasmtime
|
||||
numpy
|
||||
numpy
|
||||
yaml
|
||||
@@ -41,7 +41,8 @@ EXTRA_REQUIRE = {
|
||||
"aiofile",
|
||||
"cloudscraper",
|
||||
"wasmtime",
|
||||
"numpy"
|
||||
"numpy",
|
||||
"yaml",
|
||||
],
|
||||
'slim': [
|
||||
"curl_cffi>=0.6.2",
|
||||
@@ -62,12 +63,13 @@ EXTRA_REQUIRE = {
|
||||
"python-docx",
|
||||
"python-dotenv",
|
||||
"aiofile",
|
||||
"cloudscraper"
|
||||
"cloudscraper",
|
||||
"yaml",
|
||||
],
|
||||
"image": [
|
||||
"pillow",
|
||||
"cairosvg",
|
||||
"beautifulsoup4"
|
||||
"beautifulsoup4",
|
||||
],
|
||||
"webview": [
|
||||
"pywebview",
|
||||
@@ -80,6 +82,7 @@ EXTRA_REQUIRE = {
|
||||
"uvicorn",
|
||||
"python-multipart",
|
||||
"a2wsgi",
|
||||
"yaml"
|
||||
],
|
||||
"gui": [
|
||||
"werkzeug", "flask[async]",
|
||||
@@ -95,7 +98,7 @@ EXTRA_REQUIRE = {
|
||||
],
|
||||
"files": [
|
||||
"beautifulsoup4",
|
||||
"markitdown[all]"
|
||||
"markitdown[all]",
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user