基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/genlayerlabs/genlayer-studio --skill unit-tests命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | unit-tests |
| description | Setup Python virtual environment and run unit tests with gltest |
Setup the Python environment and run unit tests for GenLayer Studio.
pip install virtualenv)# Remove existing venv if present
rm -rf .venv
# Create new venv with Python 3.12
virtualenv -p python3.12 .venv
# Activate
source .venv/bin/activate
# Upgrade pip
pip install --upgrade pip
# Install all dependencies
pip install -r requirements.txt
pip install -r requirements.test.txt
pip install -r backend/requirements.txt
# Set Python path
export PYTHONPATH="$(pwd)"
# Activate venv (if not already)
source .venv/bin/activate
export PYTHONPATH="$(pwd)"
# Run all unit tests
gltest --contracts-dir . tests/unit
# Run specific test file
gltest --contracts-dir . tests/unit/test_specific.py
# Run with verbose output
gltest --contracts-dir . tests/unit -v
# Run specific test function
gltest --contracts-dir . tests/unit/test_file.py::test_function_name
source .venv/bin/activate && export PYTHONPATH="$(pwd)" && gltest --contracts-dir . tests/unit
# Check available Python versions
which python3.12
# On macOS with Homebrew
brew install python@3.12
# Make sure venv is activated
source .venv/bin/activate
# Reinstall test dependencies
pip install -r requirements.test.txt
# Ensure PYTHONPATH is set
export PYTHONPATH="$(pwd)"
# Verify from project root
pwd # Should be genlayer-studio