h3-spark / scripts /run_comfy_cpu_pytest.py
Frosty40's picture
DGX Spark serving config: source, kernels, receipts, validated env (part 3)
ea2ed3e verified
Raw
History Blame Contribute Delete
604 Bytes
#!/usr/bin/env python3
"""Run pytest with ComfyUI forced into CPU mode before test collection."""
from __future__ import annotations
import sys
import comfy.options
def main() -> int:
pytest_args = sys.argv[1:]
# comfy.cli_args parses the process argv lazily when the tested modules
# import model_management. Keep pytest's arguments out of that parser and
# make device discovery CPU-only.
sys.argv = [sys.argv[0], "--cpu"]
comfy.options.enable_args_parsing()
import pytest
return pytest.main(pytest_args)
if __name__ == "__main__":
raise SystemExit(main())