Maintain the legacy implementation-oriented Nexent Python unit tests under test/backend, test/sdk, and test/ext_components. Use for pytest fixtures, lookup-site
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-nexent-python-tests-65b92149226e ,按照其中的说明把「nexent-python-tests」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Paths below are relative to the repository root.
These tests are a legacy suite kept separate from the requirement-driven D1-D5 system. Do not assign formal D1-D5 case IDs to them, add them to test/manifests/d1-d5.yaml, or count them in the generated functional baseline. Use nexent-test-assets for new D1-D5 work.
test/conftest.py, and test/pytest.ini before changing fixture/import setup.pytest-mock. Files/functions start with test_; test classes start with Test. Keep files below 500 lines or split by feature using test_<module>_<feature>.py; split package directories include __init__.py.For example, if backend.services.example_service imports fetch using from provider import fetch, patch backend.services.example_service.fetch. If the runtime loads the module as services.example_service, use that actual path. Do not copy an unrelated service path from an example.
autouse=True when every test in a scope requires it. Do not mock away the behavior being asserted.side_effect for collaborator errors, @pytest.mark.parametrize for variants, and @pytest.mark.asyncio for async tests. Async collaborators need awaitable mocks.pytest test/backend/apps/test_agent_app.py -v. Broaden when needed; python test/run_all_test.py is the existing broad runner.Report commands, results, and environment failures. Unit-test isolation does not replace live-service functional checks or real-model acceptance.