#!/bin/bash if command -v pytest &> /dev/null; then echo "pytest 已安装,版本: $(pytest --version)" # 跳过安装 else echo "pytest 未安装,正在安装..." # 使用 pip 安装 (最常见) pip install pytest fi pytest -vs ./test