mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-26 17:39:15 +00:00
fix: resolve test import errors and module collision in assets_test
Extract helper functions from conftest.py to a dedicated helpers.py module to fix import resolution issues when pytest processes subdirectories. Rename test_tags.py to test_tags_api.py to avoid module name collision with queries/test_tags.py. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
14
tests-unit/assets_test/helpers.py
Normal file
14
tests-unit/assets_test/helpers.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""Helper functions for assets integration tests."""
|
||||
import time
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
def trigger_sync_seed_assets(session: requests.Session, base_url: str) -> None:
|
||||
"""Force a fast sync/seed pass by calling the seed endpoint."""
|
||||
session.post(base_url + "/api/assets/seed", json={"roots": ["models", "input", "output"]}, timeout=30)
|
||||
time.sleep(0.2)
|
||||
|
||||
|
||||
def get_asset_filename(asset_hash: str, extension: str) -> str:
|
||||
return asset_hash.removeprefix("blake3:") + extension
|
||||
Reference in New Issue
Block a user