mirror of
https://github.com/pyecharts/pyecharts.git
synced 2026-02-01 17:46:01 +00:00
update test code and workflow
This commit is contained in:
parent
f37241a768
commit
86369543f6
2
.github/workflows/python-app.yml
vendored
2
.github/workflows/python-app.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
|
||||
exclude: # Python < v3.8 does not support Apple Silicon ARM64.
|
||||
- python-version: "3.7"
|
||||
os: macos-latest
|
||||
|
||||
@ -55,3 +55,16 @@ class TestEngine(unittest.TestCase):
|
||||
|
||||
# importlib.reload(collections.abc) # 重新加载模块以应用补丁
|
||||
assert collections.abc.Iterable.__module__ == "collections.abc"
|
||||
|
||||
def test_iterable_import(self):
|
||||
# 尝试从 collections.abc 导入 Iterable
|
||||
try:
|
||||
from collections.abc import Iterable
|
||||
self.assertTrue(True) # 如果成功导入,测试通过
|
||||
except ImportError:
|
||||
# 如果从 collections.abc 导入失败,则尝试从 collections 导入
|
||||
try:
|
||||
from collections import Iterable
|
||||
self.assertTrue(True) # 如果这里成功导入,测试通过
|
||||
except ImportError:
|
||||
self.fail("Failed to import Iterable from both collections.abc and collections") # 如果两者都失败,则测试不通过
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user