一键导入
unit-tests
Run Django unit tests in the edx-enterprise Docker container. Use when the user wants to run tests, check if tests pass, or verify test coverage.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run Django unit tests in the edx-enterprise Docker container. Use when the user wants to run tests, check if tests pass, or verify test coverage.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | unit-tests |
| description | Run Django unit tests in the edx-enterprise Docker container. Use when the user wants to run tests, check if tests pass, or verify test coverage. |
| argument-hint | <TEST_FILES> |
| allowed-tools | Bash(docker *), Bash(make *), Bash(colima *) |
<TEST_FILES> (optional): One or more folders, test file paths, or pytest node IDs to run. Coverage is only enabled when a single folder representing a code domain is provided or no arguments are provided.
Examples:
/unit-tests — run all tests with coverage/unit-tests tests/test_enterprise/test_tasks.py — run one test file without coverage/unit-tests tests/test_enterprise/test_tasks.py tests/test_consent/test_helpers.py — run multiple test files without coverage/unit-tests tests/test_enterprise/test_tasks.py::TestSomeClass::test_method — run a single test by node ID without coverageAlways run this first — it is idempotent, and it also generates the .env
file which gives each clone of this repo its own docker compose project name
(so multiple clones don't fight over the same container):
make dev.up
IMPORTANT: always interact with the container via docker compose (which
reads .env), never via bare docker commands with a hardcoded container
name — the container name is different in every clone.
If <TEST_FILES> is provided, run only those tests using pytest.local.ini to disable coverage and warnings:
docker compose exec test-shell bash -c "pytest -c pytest.local.ini <TEST_FILES>"
Never enable coverage reports (by adding --cov) when only testing specific files, since the results will be misleading.
If no arguments are given, assume the user wants to run the full test suite for the entire project:
docker compose exec test-shell make test
Whole-project coverage will be reported in the console output. Specific line numbers with missing coverage will be reported.
If tests fail due to missing imports, first try to install requirements:
docker compose exec test-shell make requirements
This is necessary at least when adding new requirements which have not yet been built into the image.
This likely just means colima needs to be started:
colima start