tests/conftest.py
sys.path
ASCEND_CUSTOM_OPP_PATH
sys.path.append
sys.path.insert
tests/utils/utils/torch_npu_mock.py
mock_torch_npu()
tests/run.py
tests/UT/run.py
conftest.py
# pylint: disable=no-name-in-module
@unittest.skipIf
pre-commit/pyproject.toml
duplicate-code
bash cd tests # 运行全量测试(含覆盖率报告) bash run_test.sh # 仅运行 CPU 兼容测试(无需 NPU 环境) bash run_test.sh --cpu_only # 仅运行 NPU 依赖测试 bash run_test.sh --npu_only
bash cd tests # 运行单个测试文件 bash run_test.sh quantization/test_layer.py # 运行多个测试文件 bash run_test.sh layers/test_embedding.py quantization/test_mode.py # CPU 模式下运行单个文件 bash run_test.sh --cpu_only quantization/test_mode.py
bash # pytest 方式(支持更多过滤选项) python -m pytest tests/quantization/test_layer.py -v
MINDIE_TEST_MODE=CPU python -m pytest tests/ -k "not NPU"
pre-commit run --all-files
bash build/build_ops.sh
customize_transformer
python tests/run.py