Runs inside ComfyUI's venv without a server, loading the pack (its folder
name has hyphens) as the importable package `snk`:
~/ComfyUI/venv/bin/python -m pytest custom_nodes/comfyui-shadernoiseksampler/tests
- helpers.py: package loader, a FakeModel carrying ComfyUI's real
model_sampling/latent_format objects, and a recording fake for
comfy.sample.sample.
- test_generators_smoke.py: every generator must return [B, C, H, W] and
finite values across octaves, channels, masks and colour schemes. This
is what caught the tensor_field crash.
- golden_cases.py / capture_golden.py / test_legacy_golden.py: 11 recorded
configurations pinning exactly what the pre-2.0 pipeline sends to the
sampler, so the upcoming refactor cannot change legacy behaviour.
pytest.ini lives in tests/ so this directory is the rootdir; otherwise
pytest imports the pack's __init__.py as a test package and fails on its
relative imports.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
11 lines
527 B
INI
11 lines
527 B
INI
# Pytest config lives here, not in pyproject.toml, on purpose: the pack's root
|
|
# directory has an __init__.py, so a rootdir above this one makes pytest import
|
|
# that file as a test package, which fails (its relative imports have no parent
|
|
# package). Keeping the config here makes this directory the rootdir.
|
|
#
|
|
# Run with ComfyUI's venv so `comfy` is importable:
|
|
# ~/ComfyUI/venv/bin/python -m pytest custom_nodes/comfyui-shadernoiseksampler/tests
|
|
[pytest]
|
|
testpaths = .
|
|
addopts = --import-mode=importlib -p no:cacheprovider
|